[英]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.