0

I was trying to fetch YouTube analytics data and to get the access token for the same. I have followed the procedure given https://developers.google.com/youtube/analytics/authentication. We got the code but when i have tried to use POST request to get access token,i got the 400 bad request.Please help.

My Post request:

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...

One more thing do we have to ask for whitelisting of app or i am missing anything. Please help !!!

1 Answer 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`
2
  • I have omitted the response_type but still getting the same error. Commented Jan 30, 2013 at 9:57
  • feel free to share all your request and response and I'll look into it. ulukaya@google Commented Mar 15, 2013 at 19:40

Your Answer

By clicking โ€œPost Your Answerโ€, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.