简体   繁体   中英

Which type of API key for Google Cloud Datastore

https://github.com/google/google-api-php-client/tree/v1-master

It says the following in the example:

  require_once 'google-api-php-client/src/Google/autoload.php'; // or wherever autoload.php is located

  $client = new Google_Client();
  $client->setApplicationName("Client_Library_Examples");
  $client->setDeveloperKey("YOUR_APP_KEY");

  $service = new Google_Service_Books($client);
  $optParams = array('filter' => 'free-ebooks');
  $results = $service->volumes->listVolumes('Henry David Thoreau', $optParams);

  foreach ($results as $item) {
    echo $item['volumeInfo']['title'], "<br /> \n";
  }

But when I go to get my api credentials there are SO MANY different credentials I can create. Which one is it for YOUR_APP_KEY ?

https://console.developers.google.com/apis/credentials

A little confused as to why they need so many different keys.

I recommend using Google's credential wizard . It's under the "Help me choose" option when creating a new credential. You'll likely want to use a service account since you're accessing data on behalf of your application (rather than an end-user). See this documentation for PHP .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM