Ranjith
Ranjith

Reputation: 475

Response message is forbidden when queried for video on youtube analytics api

I used the youtube analytics api console ([https://developers.google.com/apis-explorer/#p/youtubeAnalytics/v1/youtubeAnalytics.reports.query?][1]) to retrieve details of videos (from my channel), values for id : channel==4aYYO.... metrics : video .
The response I get is 403 Forbidden code: 403, message: "Forbidden
Can anyone point out if I am missing any permission ?

      [1]: https://developers.google.com/apis-explorer/#p/youtubeAnalytics/v1/youtubeAnalytics.reports.query?

Upvotes: 0

Views: 544

Answers (2)

user2170704
user2170704

Reputation: 41

First, use the ChannelList method in the YouTube Data API to your Channel ID's. This must be an authenticated call, so click the Authorize Requests slider in the API explorer. Make sure you are logged in with the Google account which owns the channel.

API Explorer Query

https://developers.google.com/apis-explorer/#p/youtube/v3/youtube.channels.list?part=snippet&mine=true&_h=1&

Here is more explanation from Jeff at Google.

How do I get a list of YouTube channels, and associated channel URLs (user or channel), owned by an authenticated user

Upvotes: 0

Jeff Posnick
Jeff Posnick

Reputation: 56044

Channel ids begin with UC. Can you try UC4aYYO... and see if that works?

Upvotes: 0

Related Questions