来自 YouTube Analytics API 的内部服务器错误 [英] Internal server error from YouTube Analytics API

查看:19
本文介绍了来自 YouTube Analytics API 的内部服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

从昨天开始,我们就收到了来自 YouTube 分析 API 的代码 500 错误.相关代码从几个月前开始没有任何变化,昨天之前一切都很顺利.

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.

这是一个示例查询(但对 YT Analytics 的所有查询都失败):

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

(具有适当的 channelId 和 Authorization 标头集).这就是我们要回来的:

(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."
        }
    }
}

有什么线索吗?

推荐答案

我遇到了同样的问题:任何名为 (yt-analytics.readonly) 的 youtube API 都出现错误 500".

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

这是解决问题的解决方法:

Here is a workaround for fixing the problem :

  1. 在您的应用程序中添加以下权限 https://www.googleapis.com/auth/youtube.readonly,即使它没有用

重新生成刷新令牌

一切都是固定的

您甚至可以在没有 youtube.readonly 权限的情况下删除该应用程序并再次添加它,它仍然可以工作.就像 API 通过添加这个无用的权利得到了更新.

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.

我还使用 API 测试控制台测试了另一种解决方法,即在 youtube.readonly & 中添加Google APIs Explorer"应用程序.yt-analytics.readonly 解除了问题的阻止,并且您自己的令牌没有任何错误 500".

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 !

这篇关于来自 YouTube Analytics API 的内部服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆