I got some code from youtube data API's try-it editor.
I have some curl code here, I have the API Key, but I don't know what [YOUR ACCESS TOKEN]
is. I've been trying for the past two hours to find something, but couldn't get what I wanted.
I had an Oauth 2.0 client ID [742151xxxxxx.app.googleuserconsent.com]
in google developers console.
I used it in place of [YOUR ACCESS TOKEN]
but still got the authorization error.
Here is the cURL code:
curl \
'https://www.googleapis.com/youtube/v3/playlistItems?part=id%2C%20snippet&playlistId=pbsF2UOcspaGQkAe1BCAR395sue-tp5r&key=[YOUR_API_KEY]' \
--header 'Authorization: Bearer [YOUR_ACCESS_TOKEN]' \
--header 'Accept: application/json' \
--compressed
Here is the error JSON:
{
"error": {
"errors": [
{
"domain": "global",
"reason": "authError",
"message": "Invalid Credentials",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Invalid Credentials"
}
}