Tanatos
Tanatos

Reputation: 1917

Youtube V3 API PHP Issues

I have managed to get a valid OAuth 2 token using the Google API for Youtube, but for some reason when making a request, either in my code (PHP) or in the test tools within the Youtube API (for example : https://developers.google.com/oauthplayground/) , I keep getting the following error :

[errors] => Array(
  [0] => Array(
     [domain] => youtube.header
     [reason] => youtubeSignupRequired
     [message] => Unauthorized
     [locationType] => header
     [location] => Authorization
  )
)
[code] => 401
[message] => Unauthorized

OR

{
 "error": {
  "errors": [
   {
    "domain": "usageLimits",
    "reason": "accessNotConfigured",
    "message": "Access Not Configured"
   }],
   "code": 403,
   "message": "Access Not Configured"
  }
}

Can anyone please advise ?

Thank you in advance.

Upvotes: 0

Views: 603

Answers (1)

Ikai Lan
Ikai Lan

Reputation: 2240

This probably means you have not yet enabled the YouTube Data API. 401 and 403 mean completely different things, however, so here's a checklist of things I would look for:

  1. Verify that you have enabled the YouTube Data API in the Google API Console. It'll be under "Services". You'll need to flip them on. We did a short video tutorial about how to enable and retrieve developer keys.
  2. If you're making an API call to upload videos or edit playlists, you'll need the account you're authorizing as to have a linked channel.

When these are done, you'll be able to download and run the PHP samples. We have a tutorial video for that as well.

Upvotes: 1

Related Questions