I am trying to resume downloading on youtube using rest api clients. STEP 1:
https://www.googleapis.com/upload/youtube/v3/videos?uploadType=resumable&part=snippet,status,contentDetails
Headings
Authorization Bearer ya29.1.AADtN_UxUBz459k8HO_gropj2SW6ShlFsqBqJMXI3HVfcE4lKWkR-gq4_Tj0j6Oqb-oo_qnE Content-Length 278 Content-Type application/json; charset=UTF-8 X-Upload-Content-Length 1393167 x-upload-content-type application/octet-stream
Body
{ "snippet": { "title": "My video title", "description": "This is a description of my video", "tags": ["cool", "video", "more keywords"], "categoryId": 22 } }
I get a response of 200 Ok. I will retrieve the url that is used in a further request.
STEP-2:
https://www.googleapis.com/upload/youtube/v3/videos?uploadType=resumable&part=snippet,status,contentDetails&upload_id=AEnB2UqmDFhqQrOpbIgMp_E_bBUJeKfRyJfjfjfjfjfjfjfjfjfjfjfkfkf
Headings
Authorization Bearer ya29.1.AADtN_UxUBz459k8HO_gropj2SW6ShlFsqBqJMXI3HVfcE4lKWkR-gq4_Tj0j6Oqb-oo_qnE Content-Length 1393167 Content-Type application/octet-stream
Body
VideoFile - abcd.mp4
When I try to upload a file, it returns 400 with the following answer.
{ error: { errors: [1] 0: { domain: "global" reason: "badRequest" message: "Invalid Upload Request" }- - code: 400 message: "Invalid Upload Request" }- }
I tried to execute the above request from the client - Advanced REST API and Postman REST client from Google chrome, Java program - wherever it returns 400. Can someone please indicate what error I am making in step 2. It would be very useful.
rest youtube youtube-api file-upload
user3337031
source share