簡體   English   中英

Google API PHP客戶端無法獲取聯系人

[英]Google API PHP Client cannot get contacts

我使用了類似於https://code.google.com/p/google-api-php-client/source/browse/trunk/examples/contacts/simple.php的第49行到第54行的代碼,但是invalid_grant錯誤。 我進入了Google API控制台,我無法提交要授予的Google通訊錄服務。

請幫我。

您是否在以下幾行中包含了正確的設置? 您需要在API控制台中創建應用程序設置,然后將這些設置插入下面的代碼中。 一旦所有設置正確,此代碼對我來說就是完美的。

$client = new Google_Client();
$client->setApplicationName('Google Contacts PHP Sample');
$client->setScopes("http://www.google.com/m8/feeds/");
// Documentation: http://code.google.com/apis/gdata/docs/2.0/basics.html
// Visit https://code.google.com/apis/console?api=contacts to generate your
// oauth2_client_id, oauth2_client_secret, and register your oauth2_redirect_uri.
// $client->setClientId('insert_your_oauth2_client_id');
// $client->setClientSecret('insert_your_oauth2_client_secret');
// $client->setRedirectUri('insert_your_redirect_uri');
// $client->setDeveloperKey('insert_your_developer_key');

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM