Reputation: 7900
I want to add a video to playlist, and i use this URL:
https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&key=MY_KEY
And this is the Request body:
{
"snippet": {
"playlistId": "PLy-aWRoARIeVFnbSzxnfTI2lyTbEC0Nek",
"resourceId": {
"videoId": "EHkozMIXZ8w",
"kind": "youtube#video"
}
}
}
And i am getting this error:
"message": "Playlist item id not specified."
Any idea what can be the problem?
Upvotes: 1
Views: 946
Reputation: 301
Use insert method
POST https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&key={YOUR_API_KEY}
with body
{
"snippet": {
"playlistId": "playlist_id",
"resourceId": {
"videoId": "video_id",
"kind": "youtube#video"
}
}
}
Upvotes: 0
Reputation: 56
I had same problem. The problem was in using PUT method (as in PlaylistItems: update) instead of required POST.
Upvotes: 4
Reputation: 1415
The url and data seems to be fine. I think the problem lies elsewhere. Did you specify sending json data ? ('Content-Type: application/json')
Upvotes: 0