post
https://partner.gupshup.io/partner/bizgate/app//media
Uploads an image, video, document, or audio file to WhatsApp and returns the reusable media id that can be referenced when sending a message.
Request parameters
Path parameters
| Key | Description | Values | Data Type | Required/Optional |
|---|---|---|---|---|
| appId | Identifier of the WhatsApp app the call acts on. | 6f414190-d45c-4671-bca1-fb6c3018cb13 | String | Required |
Body
| Key | Description | Values | Data Type | Required/Optional |
|---|---|---|---|---|
| file | The media, as a binary part or as a public URL | https://example.com/image.jpeg | — | Required |
| file_type | MIME type of the media | image/jpeg | — | Required |
Sample cURL — Upload media and get media id.
curl --request POST \
--url 'https://partner.gupshup.io/partner/bizgate/app/6f414190-d45c-4671-bca1-fb6c3018cb13/media' \
--header 'Authorization: Bearer <UT>' \
--header 'Accept: application/json' \
--form 'file=@/path/to/file' \
--form 'file_type=image/jpeg'Sample success response (200)
{
"status": "success",
"data": {
"mediaId": "1852559851913765"
}
}Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…