Search code examples
google-api-php-clientgoogle-maps-engine

How to generate the API/developer key for Google APIs Client Library for PHP


I need to generate a simple API Key for me to be able to authenticate from Google App Engine/PHP via google-api-php-client and get the list of layers in maps engine the user has access to.

I am trying to follow the instructions at https://developers.google.com/api-client-library/php/guide/aaa_apikeys to create the simple API key (also known as a developer key in some other documents).

Step 3 of those instructions says:

...

  1. In the sidebar on the left, expand APIs & auth. Next, click APIs. In the list of APIs, make sure the status is ON for the Google APIs Client Library for PHP.

...

But I can't find that API in the list of APIs!

Where is that API? Was it renamed or removed?
Do I need both the Google APIs Client Library for PHP key and also the Maps Engine API key, or just the Google APIs Client Library for PHP key?

What key do I have to put in $client->setDeveloperKey('?????????????????????');

Thank your for your time!


Solution

  • It looks like that doc is slightly misleading. You do not need a separate key for the PHP client library, you only need a key for the Maps Engine API.

    Make sure you've got that enabled and then any key you set up in the project console will work for any of the APIs you have enabled.