0

I've created a service account for use with the YouTube Content ID API, I'm following the steps under Set up your service account on:

https://developers.google.com/youtube/partner/guides/oauth2_for_service_accounts

The steps seem to be a bit outdated, I am not able to find YouTube Content ID API in Developer console.

I am able to upload a video on a channel. Well, when I'm making requests using this service account, I'm getting forbidden errors. For example the below error is when I'm trying to get a list of content owners.

error::::::{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "insufficientPermissions",
    "message": "Insufficient Permission: Request had insufficient authentication scopes."
   }
  ],
  "code": 403,
  "message": "Insufficient Permission: Request had insufficient authentication scopes."
 }
}

Here's the PHP code:

$client = new Google_Client();
    $client->setAccessType("offline");
    $client->setApprovalPrompt("force");
    $client->setClientId($OAUTH2_CLIENT_ID);
    $client->setClientSecret($OAUTH2_CLIENT_SECRET);
$client->setScopes(array('https://www.googleapis.com/auth/youtube', 'https://www.googleapis.com/auth/youtubepartner'));
        $youtube = new Google_Service_YouTube($client);

    $youtubePartner = new Google_Service_YouTubePartner($client);
$contentOwnersListResponse = $youtubePartner->contentOwners->listContentOwners(
          array('fetchMine' => true));
          $contentOwnerId = $contentOwnersListResponse['items'][0]['id'];
1
  • 1
    You have mentioned that you cannot see the "YouTube Content ID API" in your Google Developers Console, I think you need to check the YouTube Partner Program. Please do take note that "The YouTube Content ID API is intended for use by YouTube content partners and is not accessible to all developers or to all YouTube users". It was stated in the note at the top most of the page. Commented Feb 27, 2019 at 9:01

1 Answer 1

0

You have mentioned that you cannot see the "YouTube Content ID API" in your Google Developers Console, I think you need to check the YouTube Partner Program. Please do take note that "The YouTube Content ID API is intended for use by YouTube content partners and is not accessible to all developers or to all YouTube users". It was stated in the note at the top most of the page.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.