Upload Large Media Files
For file uploads greater than 10 MB, obtain a presigned URL to upload a file.
For file uploads greater than 10 MB, obtain a presigned URL to upload a file.
- Maximum file upload size 5 GB.
- Upload presigned URL valid for 30 minutes after being generated.
- Access URL available for 30 days after uploaded. All published posts are unaffected at the social networks. Scheduled posts beyond that time frame will result in errors at time of publishing.
Header Parameters
Authorization: Bearer API_KEY
. See API overview for more information.Query Parameters
If the contentType is not present, then a full file name with extension is required.
Name of the file to be uploaded. Must include an extension such as .png, .jpg, .mov, .mp4, etc.
The content-type of the media being uploaded. Valid formats include: mp4
, quicktime
, png
, jpg
, or jpeg
.
If not present, application/octet-stream will be used.
Reponse Details
accessUrl
is the URL to access the media file after upload.contentType
is the content-type set for the media being upload. Use this in the Content-Type header when uploading the media.uploadUrl
is the URL used to PUT the media file. Please see below.
Additional Endpoint Examples
The process to upload larger files:
- Obtain an
uploadURL
andaccessURL
via the/media/uploadUrl
endpoint. Please see above. - Upload the file via a PUT with Content-Type set to the returned
contentType
. - Upload the media by using the
--upload-file
with a media file and theuploadUrl
. - After uploading the media file, POST to the
/post
endpoint with theaccessUrl
in themediaUrls
body parameter. - The presigned upload URL may only be uploaded to once. If you sent a bad file you must create a new upload URL. No error response will occur if the file is not successfully uploaded. See below of verifying the URL exists.
Please be sure that the contentType
set when creating the uploadUrl
matches the Content-Type and the file type when PUTing the file. For example, if you set the contentType
to “image/png” when creating the uploadUrl
, be sure to set the “Content-Type: image/png” and the uploaded file ends in “.png”.
Example Upload File Binary in Node.js
Here is an example of uploading a binary media file using Node with JavaScript:
Example Upload Binary File in Postman
You may also use Postman to upload the binary file to the uploadUrl
.
In Postman:
- Select the HTTP Method
PUT
. - Paste your
uploadUrl
in the url field. Note, the url will expire after an hour and may only be used once. If you make a call and it fails, you must regenerate theuploadUrl
. - In Headers set the
Content-Type
to be the content type returned in the /uploadUrl endpoint. For example:Content-Type: image/png
. - Select Body -> binary and select the file to upload.
- Press Send.
- Important: No return response will occur, so you should check if the upload was successful by opening the
accessUrl
returned from the /uploadUrl endpoint in a browser. You may also use the verify URL endpoint.