0

On my google account (not a Primary account), I have created OAuth credentials which have access to CMS and it's Channels. Using this credentials I am able to fetch data from YouTube Analytics API, so here no problem.

However, when I am trying access YouTube Reporting API, I am only getting the list of reports of Content Owners Reports with an addition of onBehalfOfContentOwner=cms._id parameter and the CMS ID.

def list_report_types(cms):
 reporting = youtube.reporting()
 request = reporting.reportTypes().list(onBehalfOfContentOwner=cms._id)
 results = youtube.query(request)
 return results.get('reportTypes') 
report_types = list_report_types(cms)

Can anyone help me to also get the list of reports of Channels also?

So when I try to schedule a channel_basic_a2 report, it gives me below error

HttpError 403 when requesting https://youtubereporting.googleapis.com/v1/jobs?alt=json&onBehalfOfContentOwner=cmsid returned "The caller does not have permission">

Thanks in advance.

Dhiren
  • 5
  • 3

1 Answers1

0

Two possible issues:

Are the oauth credentials you are using service account credentials? Service accounts do not work for the Youtube Reporting API. See this answer.

Also, have you checked your scopes definition?

hbrannan
  • 153
  • 1
  • 7