我正在使用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。
當然可以。我沒有在這裏顯示,原因很明顯。我的代碼實際上已經包含這兩個 –
那麼你可能需要把它與谷歌!祝你好運。 –