2016-11-04 105 views
0

我收到以下例外(403)访问未配置。 Google Cloud Datastore API

Google_Service_Exception:调用POST的错误https://www.googleapis.com/datastore/v1beta2/datasets/smartflowviewer/lookup:(403)Access Not Configured。 Google Cloud Datastore API尚未在项目529103574478中使用过,或者被禁用。通过访问https://console.developers.google.com/apis/api/datastore/overview?project=529103574478启用它,然后重试。如果您最近启用了此API,请等待几分钟,以便将操作传播到我们的系统并重试。

试图访问数据存储

$service = new Google_Service_Datastore($client); 
$service_dataset = $service->datasets; 

$path = new Google_Service_Datastore_KeyPathElement(); 
$path->setKind('auth'); 
$path->setName($email); 
$key = new Google_Service_Datastore_Key(); 
$key->setPath([$path]); 
$lookup_req = new Google_Service_Datastore_LookupRequest(); 
$lookup_req->setKeys([$key]); 

$response = $service_dataset->lookup('smartflowviewer', $lookup_req); 

我使用OAuth的Web客户端API

$client = new Google_Client(); 
$client->setClientId($cfg['CLIENT_ID']); 
$client->setClientSecret($cfg['CLIENT_SECRET']); 
$client->setAccessType('offline'); 

该项目一直在努力完全正常,直到昨天上班。我没有在最近一个月内部署任何新代码或更改任何设置。突然它开始抛出这个错误。

什么可能会导致此行为的任何想法?非常感谢。

回答

2

Cloud Datastore v1beta2 API为deprecated,但您可以更新代码以使用Cloud Datastore v1 API。

一种选择是查看php-gds库。

+0

非常感谢。我已经转移到最新版本。它现在有效。 –

相关问题