Sunel
Sunel

Reputation: 51

Error while accessing mirror api using php sdk

i am using the php sdk for mirror api I have completed the authentication proceess by when get the timeline card exception error throughs

Fatal error: Uncaught exception 'Google_ServiceException' with message 'Error calling GET https://www.googleapis.com/mirror/v1/timeline?maxResults=3&key=-DBblCsty21sfV9MTpZoKNvxsss: (403) Access Not Configured' in /var/www/glass/google-api-php-client/src/io/Google_REST.php:66 
Stack trace:
#0 /var/www/glass/google-api-php-client/src/io/Google_REST.php(36): Google_REST::decodeHttpResponse(Object(Google_HttpRequest))
#1 /var/www/glass/google-api-php-client/src/service/Google_ServiceResource.php(186): Google_REST::execute(Object(Google_HttpRequest))
#2 /var/www/glass/google-api-php-client/src/contrib/Google_MirrorService.php(434): Google_ServiceResource->__call('list', Array)
#3 /var/www/glass/index.php(137): google_TimelineServiceResource->listTimeline(Array) #4 {main} thrown in /var/www/glass/google-api-php-client/src/io/Google_REST.php on line 66

Upvotes: 1

Views: 590

Answers (2)

Tarun Gupta
Tarun Gupta

Reputation: 6403

Google APIs have been known to misbehave when you provide both OAuth2 credentials and an API Key. Also since you have to use OAuth2 to access the Mirror API, the key=xxxxx isn't necessary anyway.

If you are using the Google APIs Client Library for PHP you can simply remove the following line from your code:

 $client->setDeveloperKey($key);

Not entirely sure if this causes your issue, but I have come across similar issues in other Google APIs.

Upvotes: 1

Prisoner
Prisoner

Reputation: 50701

At a glance, it sounds like you haven't enabled the Mirror API in the code console for this project.

  1. Go to https://code.google.com/apis/console/ and select the project you're working on.
  2. Select the Services menu item on the left.
  3. Scroll down to the Google Mirror API and make sure it is turned on.

If you do not have this API available, it means you haven't been whitelisted for it. If you're a Glass Explorer, contact a Glass Guide using the 800 number or the email address for support and ask to be permitted. If you are not a Glass Explorer, the API isn't available to you at this time unless a Glass Explorer permits you access to one of their projects.

Upvotes: 0

Related Questions