[英]Which type of API key for Google Cloud Datastore
https://github.com/google/google-api-php-client/tree/v1-master
在示例中显示以下内容:
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";
}
但是,当我去获取我的api凭据时,可以创建很多不同的凭据。 您的YOUR_APP_KEY
是哪一个?
https://console.developers.google.com/apis/credentials
为什么他们需要这么多不同的键有些困惑。
我建议使用Google的凭据向导 。 创建新凭据时,它位于“帮助我选择”选项下。 您可能要使用服务帐户,因为您是代表应用程序(而非最终用户)访问数据。 请参阅此PHP文档 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.