Php DrEdit样本访问未配置错误
我正在尝试使用Google Drive API和Drive SDK编写我的第一个应用程序。我正在尝试从google drive打开文件。这是我的密码:Php DrEdit样本访问未配置错误,php,google-drive-api,google-drive-realtime-api,Php,Google Drive Api,Google Drive Realtime Api,我正在尝试使用Google Drive API和Drive SDK编写我的第一个应用程序。我正在尝试从google drive打开文件。这是我的密码: if(isset($_GET['state'])){ $json = $_GET['state']; $obj = json_decode($json); $idTab = $obj->{'ids'}; $id = $idTab[0]; $file = printFile($service, $id)
if(isset($_GET['state'])){
$json = $_GET['state'];
$obj = json_decode($json);
$idTab = $obj->{'ids'};
$id = $idTab[0];
$file = printFile($service, $id);
}
function printFile($service, $fileId) {
try {
$file = $service->files->get($fileId);
return $file;
} catch (Exception $e) {
print 'Error: '.$e->getMessage();
return null;
}
}
function downloadFile($file) {
$downloadUrl = $file->getDownloadUrl();
if ($downloadUrl) {
$request = new Google_HttpRequest($downloadUrl, 'GET', null, null);
$httpRequest = Google_Client::$io->authenticatedRequest($request);
if ($httpRequest->getResponseHttpCode() == 200) {
return $httpRequest->getResponseBody();
} else {
// An error occurred.
return null;
}
} else {
// The file doesn't have any content stored on Drive.
return null;
}
}
我已经在API控制台中启用了Google驱动API和驱动SDK。我已经设置了我的客户端ID、电子邮件地址、web应用程序的客户端密码以及API密钥和允许的引用(接受来自HTTP的请求)。我已经在Google Drive SDK中输入了所有必要的数据,如客户端ID、开放URL。我的其他范围包括:[https://www.googleapis.com/auth/userinfo.profile], [https://www.googleapis.com/auth/drive.install], [https://www.googleapis.com/auth/drive.file], [https://www.googleapis.com/auth/drive]
我已经在谷歌商店中安装了我的应用程序,我正试图通过我的应用程序从我的驱动器打开文件。我有以下错误:
{
"error": {
"errors": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured"
}
],
"code": 403,
"message": "Access Not Configured"
}
}
我一直在寻找解决方案,但我找不到。没什么帮助。那么,有人能帮我解决这个问题吗?但是我已经打开了驱动器SDK和驱动器API服务,我仍然有错误。在您向我展示的帖子中,解决方案是打开驱动器SDK和驱动器API服务。就我而言,这不是解决办法