Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
563 views
in Technique[技术] by (71.8m points)

php - 403 error with message:Access Not Configured. Please use Google Developers Console to activate the API for your project

Can't overcome this situation: created a project in the Google developers console they created "Client ID for web application" and "Key for server applications".

In the console requests have completed successfully, but when I send from the server I get the following error:

403: {
 "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."
 }
}

Parameters to construct the query checked.. the request goes on:

"https://www.googleapis.com/calendar/v3/freeBusy?key=my_key"
pass parameters: "{"items":[{"id":"calendar_id@group.calendar.google.com"}],"timeMax":"2014-04-09T00:00:00+01:00","timeMin":"2014-01-09T00:00:00+01:00","timeZone":"Europe/Berlin"}"

Where can I see what the error is?

Whether in this help Billing (at the moment it is turned off "Billing is not enabled")?

========================== UPDATED: The problem was resolved so (like shamanism): I just created a new project in the google api, next tab "APIs&auth->Credentials" I added to the project "Client ID for web application", when you create immediately pointed out "Redirect URIs" when you create is automatically generated "Key for browser applications"that can work with any host). After these steps, I point to a website created settings and requests are.

To send requests to use drupal and modules: gauth and gcal (which uses http://code.google.com/p/google-api-php-client/).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I was getting the exact same error (except with the Google Glass Mirror API). Adding billing information and adding both http/https to my redirect URL didn't help either.

Apparently Google APIs have been known to misbehave when you provide both OAuth2 credentials and an API Key! The solution (if you are using the Google APIs Client Library for PHP) is to simply remove the following from your code:

$client->setDeveloperKey($key);

Hope this helps.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...