我正在使用Google Business API并且认证范围不足 . 以下是我在申请Google Business API时遇到的错误
{
"error": {
"code": 403,
"message": "Request had insufficient authentication scopes.",
"status": "PERMISSION_DENIED"
}
}
我正在使用Codeigniter PHP Framework . 这是我用来获取访问令牌的代码
require_once APPPATH . 'libraries/vendor/autoload.php';
$client = new Google_Client();
$client->setClientId($client_id);
$client->setClientSecret($client_secret);
$client->setRedirectUri($redirect_uri);
$client->addScope("https://www.googleapis.com/auth/drive");
$client->addScope("https://www.googleapis.com/auth/plus.business.manage");
$client->setAccessType('offline');
$client->addScope("email");
$client->addScope("profile");
$client->authenticate($_REQUEST['code']);
$accet = $client->getAccessToken();
$access_token = json_decode($accet)->access_token;
然后我正在处理访问令牌并发送到Business API并得到该错误 .
提前致谢 .