您的项目未启用oAuth2 Playground YouTube Analytics API [英] oAuth2 Playground YouTube Analytics API is not enabled for your project
问题描述
我坚持以下内容
我正在尝试致电YouTube Analytics API
I'm trying to make a call to YouTube Analytics API
我去了Google的oAuth2游乐场 https://developers.google.com/oauthplayground 并进入第一步,我选择并授权了所有与youtube相关的API,如屏幕截图所示
I went to google's oAuth2 playground https://developers.google.com/oauthplayground and in the first step I selected and authorized all the youtube related APIs as seen in the screenshot
然后在第2步中,我将自动授权代码交换为令牌,并在第3步中,将以下请求发送到API
Then on step 2 I exchanged the autorization code for tokens and on step 3, I send the following request to the API
https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3DMINE&start-date=2007-05-01&end-date=2015-06-30&metrics=estimatedMinutesWatched%2Cviews%2Clikes%2CsubscribersGained
我回来的是
{
"error": {
"code": 403,
"message": "Access Not Configured. The API (YouTube Analytics API) is not enabled for your project. Please use the Google Developers Console to update your configuration.",
"errors": [
{
"domain": "usageLimits",
"message": "Access Not Configured. The API (YouTube Analytics API) is not enabled for your project. Please use the Google Developers Console to update your configuration.",
"reason": "accessNotConfigured",
}
]
}
}
{
"error": {
"code": 403,
"message": "Access Not Configured. The API (YouTube Analytics API) is not enabled for your project. Please use the Google Developers Console to update your configuration.",
"errors": [
{
"domain": "usageLimits",
"message": "Access Not Configured. The API (YouTube Analytics API) is not enabled for your project. Please use the Google Developers Console to update your configuration.",
"reason": "accessNotConfigured",
}
]
}
}
但是我启用了YouTube Analytics(分析)API.
But I have the YouTube Analytics API enabled.
有什么想法吗? 非常感谢您的帮助!
Any ideas? Thank you very much for your help!
推荐答案
我们只是没有为OAuth 2.0 Playground使用的默认凭据启用此API.另一个答案表明,您始终可以为启用了Youtube Analytics API的项目提供自己的凭据.但是,我还为默认/演示凭据启用了API,因此您可以重试正在做的事情,现在应该可以正常工作了.
We simply hadn't enabled this API for the default credentials used by the OAuth 2.0 Playground. As the other answer suggests you can always provide your own credentials with a project that has the Youtube Analytics API enabled. However I've also just enabled the API for the default/demo credentials so you can try again what you were doing and things should work now.
这篇关于您的项目未启用oAuth2 Playground YouTube Analytics API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!