uploadId, never a URL. Uploading has three steps: request the address, upload the file and use the uploadId.
Types and sizes
Videos are at most 30 seconds long. The duration is read from the file before any charge. Above that, creation responds
video_too_long and no quota unit is used.
Other types respond upload_invalid. A size above the limit responds file_too_large.
1. Request the upload address
Requires thepretests:write scope.
uploadId, uploadUrl, method (always PUT), headers and expiresAt. The URL is valid for 15 minutes. If it expires, request another one.
2. Upload the file
Make aPUT to the uploadUrl with the file content as the body.
Do not send the Authorization header on this call: the URL already carries the authorization.
3. Use the uploadId
Pass the uploadId when you create the pre-test. On creation, Unite checks the uploaded file:
- If the file does not exist (you did not upload it, or the
uploadIdbelongs to another workspace), the response isupload_not_found. - If the content does not match the type, or the video has no readable duration, the response is
upload_invalid. - The declared size is only a hint. The limit applies to the real size of the file.
uploadId can be used in more than one pre-test of the same workspace.