Developers / Advanced API / Upload API
There are two ways to upload using the Upload API: you can send a file in one part, or break it into smaller parts.
Full-file Upload
Check the user's quota
Before you begin, call vimeo.videos.upload.getQuota to make sure the user has enough space available in their account, and to let them know if their video will be encoded in HD.
Get an Upload Ticket
Before you can upload a video, you'll need an upload ticket. You can get one by calling vimeo.videos.upload.getTicket. You should receive a response like this:
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok" generated_in="0.0028">
<ticket id="abcdef124567890" endpoint="http://1.2.3.4/upload?ticket_id=abcdef124567890" />
</rsp>
If uploading is currently unavailable, this method will return error 105: Service currently unavailable.
Post the Video
The next step is to POST the video, along with the ticket_id, to the endpoint returned in the vimeo.videos.upload.getTicket call.
- api_key
- Your application's API Key
- auth_token
- Auth token for user (generated from
vimeo.auth.getToken) - ticket_id
- The ticket id from
vimeo.videos.upload.getTicket - api_sig
- Signature (details here). Do not include the video.
- file_data
- The video file
You will receive the MD5 hash of the file back from this call, which you'll need to pass to the next step.
Create the Manifest
You will need to create a manifest of the MD5 of the file you uploaded. Below is the format of the manifest in XML and JSON:
<?xml version="1.0" encoding="utf-8"?>
<files>
<file md5="718a4221052e81534696bc84ef5bc195" />
</files>
{
"files": [{
"md5":
"718a4221052e81534696bc84ef5bc195"
}]
}
Confirm the Upload
The final step is to confirm the upload by calling vimeo.videos.upload.confirm. You will need to POST the manifest to this method. This will complete the upload process and return the video_id. If you do not call this method, the video will not be processed.
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok" generated_in="0.0028">
<ticket id="8d2904e33351c3d198bdeb0668b73768" video_id="12345" />
</rsp>
Segmented Upload
Check the user's quota
Before you begin, call vimeo.videos.upload.getQuota to make sure the user has enough space available in their account, and to let them know if their video will be encoded in HD.
Get an Upload Ticket
Before you can upload a video, you'll need an upload ticket. You can get one by calling vimeo.videos.upload.getTicket. You should receive a response like this:
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok" generated_in="0.0028">
<ticket id="abcdef124567890" endpoint="http://1.2.3.4/upload?ticket_id=abcdef124567890" />
</rsp>
If uploading is currently unavailable, this method will return error 105: Service currently unavailable.
Post the Video files
The next step is to POST the pieces of the video, along with the ticket_id, to the endpoint returned in the vimeo.videos.upload.getTicket call.
- api_key
- Your application's API Key
- auth_token
- Auth token for user (generated from
vimeo.auth.getToken) - ticket_id
- The ticket id from
vimeo.videos.upload.getTicket - api_sig
- Signature (details here). Do not include the video.
- file_data
- The video file
You will receive the MD5 hash of each file as you POST the pieces. You will need these, in order, for the next call.
Note: if more than a couple hours have passed since your ticket was generated, make sure to call vimeo.videos.upload.checkTicket to make sure that your ticket is still valid.
Create the Manifest
You will need to create a manifest of the MD5s of each of the videos you uploaded. The order you put them in will dictate the order that they will be pieced together. This allows you to exclude pieces of the file that were interrupted or incorrectly uploaded. Below is the format of the manifest in XML and JSON:
<?xml version="1.0" encoding="utf-8"?>
<files>
<file md5="718a4221052e81534696bc84ef5bc195" />
<file md5="5102c13e6822b630748ffb9d9c212967" />
</files>
{
"files": [{
"md5":
"718a4221052e81534696bc84ef5bc195"
},
{
"md5":
"5102c13e6822b630748ffb9d9c212967"
}]
}
Verify the Manifest
POST the manifest to vimeo.videos.upload.verifyManifest. The manifest should not be included in the signature.
If all the pieces that were uploaded are included in the manifest, this method will return the ticket_id and the MD5 of the combined file. If pieces were uploaded and not included in the manifest, this method will also return a list of the MD5s of those pieces.
Confirm the Upload
The final step is to confirm the upload by calling vimeo.videos.upload.confirm. You will need to pass the manifest to this method. This will complete the upload process and return the video_id. If you do not call this method, the video will not be processed.
<?xml version="1.0" encoding="utf-8"?>
<rsp stat="ok" generated_in="0.0028">
<ticket id="8d2904e33351c3d198bdeb0668b73768" video_id="12345" />
</rsp>
-
Vimeo: About / Blog / Developers / Jobs / Community Guidelines / Community Forums / Help Center / Site Map / Merchandise
/ Get Vimeo
