1
votes

I'm trying to pull some earnings data from youtubeAnalytics.reports.query.

My google account is linked to a YouTube CMS, that manages 100+ channels, and I'm using that google account to authenticate my request.

So to make this super simple I'm gonna use one of Google's sample requests, namely this one:

First one under Earnings/Ads in this link https://developers.google.com/youtube/analytics/sample-requests#content-owner-earnings-ads-reports

Which will lead you more importantly to this filled out API EXPLORER

inside you'll see id being contentOwner==CONTENT_OWNER_ID where CONTENT_OWNER_ID is explained in the description as:

To request data for a YouTube CMS content owner, set the ids parameter value to contentOwner==OWNER_NAME, where OWNER_NAME is the CMS name of the content owner.

Which please correct me if I'm wrong, you're supposed to get from here:

The HomePage from the CMS


I've tried countless times with different variations and I haven't gotten it to succeed once. But following the sample request linked above I always get this:

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "forbidden",
    "message": "Forbidden"
   }
  ],
  "code": 403,
  "message": "Forbidden"
 }
}

Any ideas?

1

1 Answers

1
votes

Instead of using your content owner name, you can use your content owner ID. You can find your content owner ID from the following url;

https://developers.google.com/youtube/partner/docs/v1/contentOwners/list#try-it

Most of the requests on Analytics and Reporting API are using Content Owner ID, instead of Content Owner Name.

I hope it helps.