我正在使用API Explorer工具为Google AdSense创建一些请求网址。这里是探险工具生成,让今天的收入的响应请求URL:https://www.googleapis.com/adsense/v1.4/reports?startDate=today&endDate=today&accountId=MY_ACCOUNT_ID&metric=EARNINGS&key=MY_API_KEY
AdSense API获取'错误:需要登录'
然而,当我尝试在浏览器中或在我的代码使用这个网址就给出了这样的回应:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Login Required",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Login Required"
}
}
我不知道我错过了它使用这个网址。我在我的谷歌开发者控制台上激活了adsense apis。
当然可以。我没有在这里显示,原因很明显。我的代码实际上已经包含这两个 –
那么你可能需要把它与谷歌!祝你好运。 –