Youtube api YouTube API v3-更新项目';s在播放列表中的位置(播放项目:更新)
如何更新项目在播放列表中的位置? 我使用了API资源管理器: 部分:片段 请求正文:Youtube api YouTube API v3-更新项目';s在播放列表中的位置(播放项目:更新),youtube-api,Youtube Api,如何更新项目在播放列表中的位置? 我使用了API资源管理器: 部分:片段 请求正文: { "id": "12345", "snippet": { "playlistId": "my_playlist_id", "resourceId": { "kind": "youtube#video", "videoId": "my_video_id" }, "position": 3 } } 403 Forbidden
{
"id": "12345",
"snippet":
{
"playlistId": "my_playlist_id",
"resourceId":
{
"kind": "youtube#video",
"videoId": "my_video_id"
},
"position": 3
}
}
403 Forbidden
Cache-Control: private, max-age=0
Content-Encoding: gzip
Content-Length: 125
Content-Type: application/json; charset=UTF-8
Date: Sun, 28 Apr 2013 14:23:37 GMT
Expires: Sun, 28 Apr 2013 14:23:37 GMT
Server: GSE
{
"error": {
"errors": [
{
"domain": "youtube.common",
"reason": "forbidden",
"message": "Forbidden"
}
],
"code": 403,
"message": "Forbidden"
}
}
响应:
{
"id": "12345",
"snippet":
{
"playlistId": "my_playlist_id",
"resourceId":
{
"kind": "youtube#video",
"videoId": "my_video_id"
},
"position": 3
}
}
403 Forbidden
Cache-Control: private, max-age=0
Content-Encoding: gzip
Content-Length: 125
Content-Type: application/json; charset=UTF-8
Date: Sun, 28 Apr 2013 14:23:37 GMT
Expires: Sun, 28 Apr 2013 14:23:37 GMT
Server: GSE
{
"error": {
"errors": [
{
"domain": "youtube.common",
"reason": "forbidden",
"message": "Forbidden"
}
],
"code": 403,
"message": "Forbidden"
}
}
我试过了,我认为API调用工作正常:
Request
PUT https://www.googleapis.com/youtube/v3/playlistItems?part=snippet%2CcontentDetails%2Cstatus&fields=id%2Csnippet&key={YOUR_API_KEY}
Content-Type: application/json
X-JavaScript-User-Agent: Google APIs Explorer
{
"id": "PLSvpjjbPJQDXYjfamKNrJHvyvkBfr7n1QwkVWH-4kWwk",
"snippet": {
"playlistId": "PLF-2B3_5y4x_yqhdqjdrXuse2AcK7i3XE",
"resourceId": {
"kind": "youtube#video",
"videoId": "MP1gvGcXcLk"
},
"position": 1
}
}
Response
200 OK
- Show headers -
{
"id": "PLSvpjjbPJQDXYjfamKNrJHvyvkBfr7n1QwkVWH-4kWwk",
"snippet": {
"publishedAt": "2013-03-01T16:33:20.000Z",
"channelId": "UC4_r417bYTsCoaVGgH1yYTg",
"title": "Amazing Google Glasses Demonstration at Google I/O 2012",
"thumbnails": {
"default": {
"url": "https://i.ytimg.com/vi/MP1gvGcXcLk/default.jpg"
},
"medium": {
"url": "https://i.ytimg.com/vi/MP1gvGcXcLk/mqdefault.jpg"
},
"high": {
"url": "https://i.ytimg.com/vi/MP1gvGcXcLk/hqdefault.jpg"
}
},
"channelTitle": "Matias Molinas",
"playlistId": "PLF-2B3_5y4x_yqhdqjdrXuse2AcK7i3XE",
"position": 1,
"resourceId": {
"kind": "youtube#video",
"videoId": "MP1gvGcXcLk"
}
}
}
可能是配额错误:
HTTP 403响应可能与许多不同的错误相关联,查看实际响应HTTP正文(或exception.response属性中报告的HTTP正文的序列化版本)是确定确切原因的唯一方法
不过,执行上载时出现403的一个常见原因是配额错误。详情如下: