gpt4 book ai didi

youtube-api - Youtube API v3 video.update 响应 400 - invalidRequest

转载 作者:行者123 更新时间:2023-12-04 02:50:21 25 4
gpt4 key购买 nike

问题相当简单,我无法向 youtube api video.update 发出非常简单的请求,而不会收到 400 响应,原因是“invalidRequest”。我正在使用 Youtube API Explorer ( https://developers.google.com/youtube/v3/docs/videos/update )。该帐户已获得授权。其他 API 方法(例如 playlists.update 和 videos.list)工作正常。请帮助解决此视频更新请求。

已发送测试请求:

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

Content-Type: application/json
Authorization: Bearer {AUTH_KEY}
X-JavaScript-User-Agent: Google APIs Explorer

{
"id": "{VIDEO_ID}",
"snippet": {
"title": "title change to test1",
"description": "description change to test"
}
}

收到回复:

    400 Bad Request

- Hide headers -

cache-control: private, max-age=0
content-encoding: gzip
content-length: 134
content-type: application/json; charset=UTF-8
date: Sun, 26 Jan 2014 18:48:13 GMT
expires: Sun, 26 Jan 2014 18:48:13 GMT
server: GSE

{
"error": {
"errors": [
{
"domain": "youtube.video",
"reason": "invalidRequest",
"message": "Bad Request"
}
],
"code": 400,
"message": "Bad Request"
}
}

最佳答案

似乎 snippet.categoryId 属性是必需的,但没有记录表明您必须指定它。将此属性添加到请求主体解决了问题。

关于youtube-api - Youtube API v3 video.update 响应 400 - invalidRequest,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21367817/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com