POST /initialize_file_upload
Initializes chunked video upload in Core API. This is step 1 of 3 in the upload flow:
initialize_file_uploadsend_file_chunk(repeat for all chunks)finalize_file_upload
Please note that a good tool for splitting your video file into chunks is the Linux program split that is used as follows:
split -d --bytes=4194304 supervideo.mp4 supervideo.mp4.chunk
The above command creates the files supervideo.mp4.chunk00, supervideo.mp4.chunk01, supervideo.mp4.chunk02 with a size of 4194304 bytes and the file supervideo.mp4.chunk03 (last chunk) with a size of 157927 bytes.
Endpoint
POST https://api-eu.valossa.com/core/1.0/initialize_file_upload
Content Type
Use multipart/form-data.
Form Fields
| Field | Type | Required | Description |
|---|---|---|---|
api_key | string | Yes | Your Valossa API key |
file_size_bytes | integer | Yes | Total size of the file to upload in bytes |
Response
Successful response (200) returns:
| Field | Type | Description |
|---|---|---|
upload_id | string | Upload identifier used in next steps |
file_chunk_size_bytes | integer | Required chunk size for send_file_chunk |
Example
curl -F "api_key=YOUR_API_KEY" \
-F "file_size_bytes=12740839" \
https://api-eu.valossa.com/core/1.0/initialize_file_upload
Example Response
{
"upload_id": "7c62bc7b-e143-4a81-aa83-a7eb0ec37077",
"file_chunk_size_bytes": 4194304
}
Notes
- Chunks must match
file_chunk_size_bytes, except the final chunk may be smaller. - Save
upload_id; it is required by bothsend_file_chunkandfinalize_file_upload.