0

我试图获取 YouTube 分析数据并获取相同的访问令牌。我已按照https://developers.google.com/youtube/analytics/authentication给出的程序进行操作。我们得到了代码,但是当我尝试使用 POST 请求获取访问令牌时,我收到了 400 错误请求。请帮忙。

我的帖子请求:

POST /o/oauth2/token HTTP/1.1  //Post Rquest
Host: accounts.google.com
Content-Type: application/x-www-form-urlencoded

code=4/M7LjucbJDYrZCMiqymuKCmbGxvJk...&
client_id=8465043....apps.googleusercontent.com&
client_secret=8gn6f7K...&
redirect_uri=https://qsmi.qualcomm.com/oauth2callback&
grant_type=authorization_code
response_type=4/M7LjucbJDYrZCMiqymuKCmbGxvJk...

我们还必须要求将应用程序列入白名单,否则我会遗漏任何东西。请帮忙 !!!

4

1 回答 1

0

You do not need whitelisting for using Analytics API.

You don't need "response_type" in your POST request as described under #4 in https://developers.google.com/youtube/analytics/authentication#OAuth2_Flows

Please try omitting that.

But before that, you need do the step 1 first to grant access offline.

Example:

`https://accounts.google.com/o/oauth2/auth?
client_id=1084945748469-eg34imk572gdhu83gj5p0an9fut6urp5.apps.googleusercontent.com&
redirect_uri=http://localhost/oauth2callback&
scope=https://www.googleapis.com/auth/yt-analytics.readonly&
response_type=code&
access_type=offline`
于 2013-01-30T00:32:41.910 回答