403 Forbidden Youtube API 播放列表项使用 API Explorer 插入 [英] 403 Forbidden Youtube API playlist item insert using API explorer

查看:32
本文介绍了403 Forbidden Youtube API 播放列表项使用 API Explorer 插入的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用 yt api 资源管理器(使用完全权限对资源管理器进行 oAuthd),但在尝试插入播放列表项时出现此错误

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"
             }
            }

这是请求

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"
      }
     }
    }

推荐答案

你不应该输入 id.你应该只像这样输入 playlistId

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

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

这篇关于403 Forbidden Youtube API 播放列表项使用 API Explorer 插入的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆