Skip to main content
Creating a pre-test takes an 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 the pretests:write scope.
The response carries 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 a PUT to the uploadUrl with the file content as the body.
Send all the headers in headers, with exactly the same values, including Cache-Control. If a header is missing or a value differs, the upload fails.
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 uploadId belongs to another workspace), the response is upload_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.
The same uploadId can be used in more than one pre-test of the same workspace.