karianneberg
karianneberg

Reputation: 328

How do I find out what permissions are missing when using Google's API?

I have an application that is communicating with Google's partner API to find partnered channels for a CMS. It uses this endpoint https://developers.google.com/youtube/v3/docs/channels/list with the following parameters: GET https://www.googleapis.com/youtube/v3/channels?part=snippet&managedByMe=true&onBehalfOfContentOwner=DMDMbFBm4dizhtG4fvNILQ&key={YOUR_API_KEY}

However, it gives me a generic 403 back:

{
 "error": {
  "errors": [
   {
    "domain": "youtube.channel",
    "reason": "channelForbidden",
    "message": "Forbidden",
    "locationType": "parameter",
    "location": "id"
   }
  ],
  "code": 403,
  "message": "Forbidden"
 }
}

Is there any way to debug what is actually missing? Is there a scope missing, or is there something wrong with my account's connection to the content owner? I can successfully retrieve a list over content owners with this endpoint:

GET https://www.googleapis.com/youtube/partner/v1/contentOwners?fetchMine=true&key={YOUR_API_KEY}

so the connection should be ok. What I'm using are the scopes recommended in the docs, so I'm at my wits end here with just a 403 without any extra information to go on. What else can be wrong?

Upvotes: 1

Views: 654

Answers (1)

karianneberg
karianneberg

Reputation: 328

This turned out to be missing permissions/"features" on the CMS itself. To retrieve channels, you need to have the "channels" feature set on the role you belong to.

Upvotes: 2

Related Questions