简体   繁体   English

Google Cloud Datastore的哪种API密钥类型

[英]Which type of API key for Google Cloud Datastore

https://github.com/google/google-api-php-client/tree/v1-master 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. 但是,当我去获取我的api凭据时,可以创建很多不同的凭据。 Which one is it for YOUR_APP_KEY ? 您的YOUR_APP_KEY是哪一个?

https://console.developers.google.com/apis/credentials 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 . 我建议使用Google的凭据向导 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 . 请参阅此PHP文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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