Internal server error from YouTube Analytics API

巧了我就是萌 提交于 2019-12-11 08:03:49

问题


since yesterday we are receiving code 500 errors from the YouTube Analytics API. Nothing has changed in the relevant code since a few months ago, and everything always went smoothly before yesterday.

This is a sample query (but ALL queries to YT Analytics fail):

https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3D<channelid>&metrics=views,averageViewDuration,estimatedMinutesWatched,comments,likes,dislikes,shares,subscribersGained,subscribersLost&dimensions=channel&start-date=2016-06-01&end-date=2016-06-30&start-index=1

(with appropriate channelId and Authorization header set). This is what we are getting back:

{
    "code": 500,
    "message": "The remote server returned an error: (500) Internal Server Error.",
    "response": {
        "error": {
            "errors": [{
                    "domain": "global",
                    "reason": "internalError",
                    "message": "Unknown error occurred on the server."
                }
            ],
            "code": 500,
            "message": "Unknown error occurred on the server."
        }
    }
}

Any clues?


回答1:


I got the same problem : "Error 500" for any youtube API called (yt-analytics.readonly).

Here is a workaround for fixing the problem :

  1. Add the following right on your application https://www.googleapis.com/auth/youtube.readonly, even if it's not usefull

  2. re-generate the refresh token

  3. everything is fixed

You can even remove the application and add it again wihtout the youtube.readonly right, it's still working. It's like the API got an update by adding this unusefull right.

I have also tested another workaround with the API Test Console, by adding "Google APIs Explorer" application with the youtube.readonly & yt-analytics.readonly unblock the problem and you dont have any "Error 500" with your own token.

Hope this helps and it's clear enought !




回答2:


It seems it mostly fixed this problem. I think the problem is on YouTube side. We are still waiting until they fix 100%.



来源:https://stackoverflow.com/questions/40487996/internal-server-error-from-youtube-analytics-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!