Question

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?

Was it helpful?

Solution

I had same problem. The problem was in using PUT method (as in PlaylistItems: update) instead of required POST.

OTHER TIPS

The url and data seems to be fine. I think the problem lies elsewhere. Did you specify sending json data ? ('Content-Type: application/json')

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"
  }
 }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top