david_adler
david_adler

Reputation: 10972

403 Forbidden Youtube API playlist item insert using API explorer

Playing around with yt api explorer (have oAuthd the explorer with full privileges) but getting this error when trying to insert a playlist item

403 Forbidden

            - Show headers -

            {
             "error": {
              "errors": [
               {
                "domain": "youtube.common",
                "reason": "forbidden",
                "message": "Forbidden"
               }
              ],
              "code": 403,
              "message": "Forbidden"
             }
            }

here is the request

POST https://www.googleapis.com/youtube/v3/playlistItems?part=snippet&key={YOUR_API_KEY}

    Content-Type:  application/json
    Authorization:  Bearer ya29.AHES6ZSnBwWDrjGUDHRJQx1QLM0pw3t5xqly3t95DCISfUo
    X-JavaScript-User-Agent:  Google APIs Explorer

    {
     "id": "PLmzmv3DHYPlfztdaeGokYjX6l6f-0JsIH",
     "snippet": {
      "playlistId": "PLF1D540E51D694619",
      "resourceId": {
       "videoId": "TqmU2q5erdM",
       "kind": "youtube#video"
      }
     }
    }

Upvotes: 0

Views: 870

Answers (1)

Ibrahim Ulukaya
Ibrahim Ulukaya

Reputation: 12877

You shouldn't put id. You should put playlistId only like this

{
 "snippet": {
  "playlistId": "PLpZ720-WRTJz-LFGDm1yzAoClUE6795ft",
  "resourceId": {
   "videoId": "WV4CJ7A7Yo8",
   "kind": "youtube#video"
  }
 }
}

Upvotes: 2

Related Questions