I am trying to call Youtube API for user Channels:
It returns the following response:
{
"error": {
"code": 401,
"message": "The request uses the \u003ccode\u003emine\u003c/code\u003e parameter but is not properly authorized.",
"errors": [
{
"message": "The request uses the \u003ccode\u003emine\u003c/code\u003e parameter but is not properly authorized.",
"domain": "youtube.parameter",
"reason": "authorizationRequired",
"location": "mine",
"locationType": "parameter"
}
]
}
}
I haven't been able to find a proper answer on stackoverflow or on youtube documentation to overcome this issue. Any help is greatly appreciated.
if you check the documentation for channels.list you will fine that it states
You need to be authorized by the user with that scope and send the access token as an authorization header bearer token.
I cant see how you are using php as you have not posted a full example of what you are doing.
As you can see this request requires an authorization header. With a valid access token. Your not sending one.
php example
From here