How to use Google Apps Marketplace LicenseNotification API - google-apps-marketplace

I'm trying to use LicenseNotification API from the test page here for a test app I have built, published and already installed in one of our test domains.
App status on the CWS is published (published, GAM: published) and the app works fine.
I am logged in using the app project owner and I enabled OAuth 2.0 Authorization switch. Set the applicationId (which one is right, the one from Developers Console Marketplace SDK configuration or the one from CWS aka element id? I tried both..), clicked on Execute and I get the following response
{
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "Not authorized to access the application ID"
}
],
"code": 403,
"message": "Not authorized to access the application ID"
}
}
What am I doing wrong?
EDIT: My app is published but visibility is set to "private" for my test domain only.

Related

Google Rest Api not working

I have been trying to use the google rest api for google webmaster integration into my system.
After going through it's documentation i am able to configure all it's OAuth keys and client id so when i use the Api Explorer i am getting the required reponse there.
There itself i get some url like this :
https://www.googleapis.com/webmasters/v3/sites/https%3A%2F%2Fwww.abcd.in?key={YOUR_API_KEY}
I am providing client secret key in the YOUR_API_KEY but when i hit the url in browser i get this error :
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Login Required",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Login Required"
}
}
PS: i didnt't get any api key while generating the OAuth key (if you think i shud have used any kind of API key here ).
Can anyone help ?
You need to go to Google developer console and register your own project. Make sure to enable the webmasters api and create oauth2 credentials.
The Key parameter only works for public data. Webmaster tools data is private user data so you will be using an access token and not a public api key
https://www.googleapis.com/webmasters/v3/sites/https%3A%2F%2Fwww.abcd.in?access_token={YOUR_ACCESS_TOKEN}
There is a bug in the explorer where it shows key instead of access token it has been reported to Google.
Once you have done that i recommend you find a client library in your chosen language to help you with the authentication part.
"message": "Login Required"
Means that you haven't authenticated your user properly. You should check the documentation for oauth2 or find a client library to help you code it.

Using OAuth2.0 Playground for testing

i wanted to test some API Requests from Proximity Beacon API. So i followed the steps from this site and put a test redirect url (https://developers.google.com/oauthplayground) into the OAuth-2.0-Client-ID. When i try to make an request from the playground i get following output:
{
"error": {
"status": "PERMISSION_DENIED",
"message": "Google Proximity Beacon API has not been used in project google.com:oauth-2-playground before or it is disabled. Enable it by visiting https://console.developers.google.com/apis/api/proximitybeacon.googleapis.com/overview?project=google.com:oauth-2-playground then retry. If you enabled this API recently, wait a few minutes for the action to propagate to our systems and retry.",
"code": 403,
"details": [
{
"#type": "type.googleapis.com/google.rpc.Help",
"links": [
{
"url": "https://console.developers.google.com/apis/api/proximitybeacon.googleapis.com/overview?project=google.com:oauth-2-playground",
"description": "Google developers console API activation"
}
]
}
]
}
}
obviously it is using the wrong project, but i only got to a step where i was able to pick my account but not my project. i checked everything twice and my only guess is that i cannot use this redirect_url.
So my question: Why is it trying to use the project google.com:oauth-2-playground instead of mine? And how can i change this?
The Proximity Beacon API was not enabled on the default credentials that the OAuth 2.0 Playground uses. I've just enabled that API and now this should work.
Alternatively you can setup the OAuth 2.0 Playground to use your own app's OAuth Credentials (Client ID and Client Secret) in the configuration menu of the playground.

How to use google plus domain api

I can call any Google+ API from the Google API Explorer, but any Google+ Domain API says "You do not have permission to execute this method." and returns next error:
403 Forbidden
{
"error": {
"errors": [{
"domain": "global",
"reason": "forbidden",
"message": "Forbidden"
}],
"code": 403,
"message": "Forbidden"
}
}
The same issue I have when use google+ domain .net api library.
Does Google+ Domain API work? Are there some live examples?
The two most likely reasons for getting this error with the Domain API are:
You don't have the Domain API enabled in the developer's console. You need to enable it separately from the Google+ API.
You aren't using it with a Google Apps account, but with a regular GMail account, or your Apps admin hasn't enabled Google+ for the Apps domain.

Google API returning error accessNotConfigured

I recieve This a google error when using the url directly along with a newly created project (with no other projects listed) I continously get the below error....
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
],
"code": 403,
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
}
I know there have seen a few posts on this subject. and I have followed the instructions listed. I even created new project...
turned on fusion table in console (tried with both only fusion api on and nothering else & standard api
generated public key with the referers *
Consent screen filled out
fusion table Download allowed checked
shared with permission for "anyone with link" is selected
url = https://www.googleapis.com/fusiontables/v1/tables/105Otxh5ltQsKBr-ABqYJ8vBuB6E9Ped2MfXj3AZy/templates?&key=AIzaSyCr_wIc0aEHUG6Pl08kHDYLqWRB_PqZsE0
docid = 105Otxh5ltQsKBr-ABqYJ8vBuB6E9Ped2MfXj3AZy
key = AIzaSyCr_wIc0aEHUG6Pl08kHDYLqWRB_PqZsE0
Just what am I missing. I have the google php api client to use a service account.. but if I cant pull up the tables, query or anything via the base api url then i can move forward... untill then Im stuck. Thank in advance anyone!

Cannot add notification endpoints for Google APIs project

I have an application where I use OAuth2 to grab some info from a users spreadsheet in Google Drive. I have just completed the OAuth2 procedure, which I thought was the challenging part since there are no OAuth2 libraries for xquery, but now I am running into another problem.
I send a GET request to the Google Drive SDK, which I have turned ON in the Google API Console, and get the following output:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured"
}
],
"code": 403,
"message": "Access Not Configured"
}
}
I have found this question which seems to be the cause of my error :Google API returning Access Not Configured but I am unable to complete the solution to my problem which is to " Visit code.google.com/apis/console. First, make sure the service you want is enabled under "Services". Then go to "API Access" and specify your calling domains or IP addresses." When I try to add my domain to the notification endpoints, it doesn't do it.
In addition, I see that it says "Allows webhook notifications to be sent to external domains that are owned by the user. Google verifies that the user does in fact own each of the listed domains via Webmaster Tools" in the box where you add said endpoints. Since I am on an Amazon EC2 instance I am not sure that I will be able to do that. I really hope the fact that I am on an Amazon server is not stopping me from making my app.
Any help would be appreciated, thank you all.
You should enable Drive SDK and Drive API in the API console.

Resources