Upload file
Upload a media file to use in WhatsApp sends. The response returns a media_id that you then pass to the Send Media endpoint. Send the file as multipart/form-data.
File types. Images (image/jpeg, image/png, image/webp), video (video/mp4, video/3gpp), audio (audio/aac, audio/mp4, audio/mpeg, audio/amr, audio/ogg, audio/opus) and documents (PDF, plain text, Word, Excel, PowerPoint). WhatsApp's own size limits apply.
Timing. The file is passed on to WhatsApp after this call returns. Send it within 20 minutes; a media_id used before processing finishes, or after it expires, fails with 0x17.
Response. Always HTTP 200: the upload's own status is in status_code, and its result or error in remote_response.
Authentication: stream token in the Authorization header (see Authentication in the API Overview).
Request
- Base URLhttps://api.commpeak.com/textpeak/streams
- URLhttps://api.commpeak.com/textpeak/streams/forward-upload/{account_phone_number}
- AuthAPI key in header Authorization
Path parameters
The WhatsApp Business sender phone number of this stream that the media is for, in international format, digits only.
Request body multipart/form-data
Response
Successful Response
Example response
{
"remote_response": {
"status": true,
"uploaded_media": [
{
"download_url": "https://demo.example.com/conv_media/01d1e10f-2b3c-4d5e-6f70-3707906010e2",
"file_name": "receipt.pdf",
"media_id": "01d1e10f-2b3c-4d5e-6f70-3707906010e2"
}
]
},
"status_code": 200
}Changes
No recorded changes to this operation across all 1 revision of this API.