我已經成功authenticedated使用範圍,以谷歌:如何成功登錄後獲得電子郵件和個人資料,谷歌
var scopes=['email','profile','https://www.googleapis.com/auth/drive'];
我用這個嘗試讀取用戶的電子郵件和個人資料:
function getEmail(resp)
{
var email,isFound=false;
console.log(resp);
for(var i=0;i<resp.emails.length && !isFound;i++)
{
if(resp.emails[i].type==='account')
{
email=resp.emails[i].value;
isFound=true
}
}
return email;
}
function getProfile(resp)
{
console.log(resp);
console.log("Retrieved profile for "+resp.displayName);
}
function handleResponse(resp)
{
var email=getEmail(resp);
var profile=getProfile(resp);
}
裏面handleAuthResult我打電話:
gapi.client.load('plus','v1',function(){
//request profile information
var request=gapi.client.plus.people.get({
'userid':'me',
});
//execute the request
request.execute(handleResponse);
});
取而代之的是用戶的電子郵件和個人資料頁面,我得到如下回應:
{
"code": 403,
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project.",
"data": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
],
"error": {
"code": 403,
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project.",
"data": [
{
"domain": "usageLimits",
"reason": "accessNotConfigured",
"message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
}
]
}
}
我在Google API Console
打開了Google+ API
得到這個:
{
"code": 404,
"message": "Not Found",
"data": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
],
"error": {
"code": 404,
"message": "Not Found",
"data": [
{
"domain": "global",
"reason": "notFound",
"message": "Not Found"
}
]
}
}
可能重複:http://stackoverflow.com/questions/22870082/getting-error-403-access-not-configured-please-use-google-developers- console-t – Sid
@Sid我正在使用Referrers設置中允許的任何引用。 – vamsiampolu
該問題包含其他解決方案。你嘗試過那些嗎? – Sid