1
votes

I need to get earnings details for user from YouTube

I followed below url to get earnings

https://developers.google.com/youtube/analytics/sample-requests#Content_Owner_Reports

i passed request like below

GET https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3D%3D*******************&start-date=2014-05-01&end-date=2014-06-30&metrics=earnings&key={YOUR_API_KEY}

but the result is

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "unauthorized",
    "message": "Insufficient permission to access this report."
   }
  ],
  "code": 401,
  "message": "Insufficient permission to access this report."
 }
}

My questions are:

  1. My request is right?
  2. How to get earnings in YouTube API?
  3. contentOwner==OWNER_NAME How to get OWNER_NAME for YouTube CMS?
  4. What is YouTube CMS? Please help me
1

1 Answers

0
votes

Directly from the link you posted: Sample API Requests

You also have to be authenticated as the specified channel or content owner so that the APIs Explorer can authorize your API requests using OAuth 2.0.

Answer to your first question is: No your request isn't correct. You need to be authenticated before you can access the data. Implementing OAuth 2.0 Authorization

Also: YouTube Content Manager (CMS)