Question

the problem is fairly simple, I cannot make a very simple request to youtube api video.update without getting a 400 response with a reason 'invalidRequest'. I'am using Youtube API Explorer (https://developers.google.com/youtube/v3/docs/videos/update). The account is authorized. Other API methods such as playlists.update and videos.list works just fine. Please help with this video.update request.

Test request sent:

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

Response received:

    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"
 }
}
Was it helpful?

Solution

Seems like snippet.categoryId property is required and it is not documented that you must specify it. Adding this property to a request body solved the problem.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top