0

I'm trying to upload videos to my Vimeo account via their API using the TUS approach.

I've managed to get the first step working fine, using POST https://api.vimeo.com/me/videos to create the video placeholder in Vimeo, and getting a response which includes the video upload.upload_link

The second step requires the binary data of the video to be patched to the upload link returned in step one using PATCH{upload.upload_link} along with some specific headers, which is fine, but what I'm struggling to work out is where and how exactly to include the binary data, as it doesn't really say in the Vimeo API documentation.

Do I just put the binary data in the Body, on it's own? Or do I need to insert it between some code in the body? Or do I set a parameter and add it as a key value, and if so what is the key?

Also, I'm assuming it should be a binary string and not base64, is that correct?

Any help or guidance on this would be much appreciated.

Narendra Prasath
  • 1,501
  • 1
  • 10
  • 20
  • Hi, did you ever resolve this? I'm trying to do the same thing (upload limit on my hosting package is 20mb). Do you have a working example? – The Sumo May 18 '21 at 13:41

1 Answers1

0

You put the binary data directly in the request body. Vimeo API uploading uses the tus upload protocol. There is more information about the PATCH request at https://tus.io/protocols/resumable-upload.html#patch

  • Thanks very much that's helped a lot. I've now managed to get the second step to work (sort of) in that the data has been uploaded, and I've got the return indicating that the amount of date uploaded matches the expected size of the file (indicating completion of the upload). However when I go to check on the video in Vimeo, it keeps saying 'Something Went Wrong' where it should say 'Converting'. I've tried it with both MP4 and MOV files encoded in both ANSI and UFT8. – Adam Holmes Jun 23 '20 at 23:38
  • It doesn't say what went wrong, but as the upload worked I'm guessing there must be something wrong with the data itself. Perhaps it's encoded wrong. Any ideas? – Adam Holmes Jun 23 '20 at 23:38