youtube-apiyoutube-data-apiyoutube-analyticsyoutube-analytics-api

YouTube Analytics API : 403 Forbidden Error returns Earnings Report


I have a CMS account an I'm trying to get earnings data from content owners report on Analytics API using OAuth 2.0 . Whenever I'm trying to do this through my website, I get the following error ;

Error calling GET https://www.googleapis.com/youtube/analytics/v1/reports?ids=contentOwner%3D%3DContentOwnerID&start-date=2005-01-01&end-date=2015-11-26&metrics=views%2Cearnings%2Clikes%2Cdislikes%2Cshares%2Ccomments&dimensions=30DayTotals&filters=channel%3D%3DChannel_ID: (403) Forbidden

I'm doing the same thing on TRY IT page and it works fine.

I'm thinking that I'm having issues with authenticating my domain. What do you think is the problem? How can I solve this issue?

Thank you,


Solution

  • Finally, I solved the problem..

    Whoever will have this issue, please use the CMS user's OAuth 2.0 credentials instead of using channel credentials..