POST media/upload (APPEND)¶
APPEND command is used to upload a chunk (consecutive byte
range) of the media file. For example, a 3 MB file could be split into 3
chunks of size 1 MB, and uploaded using 3
APPEND command requests.
After the entire file is uploaded, the next step is to call the
There are a number of advantages of uploading a media file in small chunks:
- Improved reliability and success rates under low bandwidth network conditions
- Uploads can be paused and resumed
- File chunks can be retried individually
- Ability to tune chunk sizes to match changing network conditions e.g on cellular clients
Requests should be
multipart/form-data POST format.
Note: The domain for this endpoint is upload.twitter.com
A successful response returns HTTP 2xx.
|Requires authentication?||Yes (user context only)|
|command||required||Must be set to
|media||required||The raw binary file content being uploaded.
It must be <= 5 MB, and cannot be used with
|media_data||required||The base64-encoded chunk of media file. It
must be <= 5 MB and cannot be used with
|segment_index||required||An ordered index of file chunk. It must be between 0-999 inclusive. The first segment has index 0, second segment has index 1, and so on.|
// Successful response returns HTTP 2XX code without any content body.