Use this API to download or retrieve media files using their media ID. This endpoint allows you to access media files that were previously uploaded through the Generate Media ID API, enabling you to download images, videos, documents, and audio files.
Important Note:
- Valid media ID required (obtained from media upload API)
- Media must belong to the requesting app
- Rate limit: 5 requests per hour (3600 seconds)
Request Parameters
Key | Description | Value | Data type | Required/Optional | Constraints |
|---|---|---|---|---|---|
Authorization | Access Token for the application | {{PARTNER_APP_TOKEN}} | String | Required | Should be a valid Partner App Access Token |
appId | App ID to fetch the access token | {{APP_ID}} | String | Required |
|
fileName | Name of the file where the media is being dowloaded | Valid file name | |||
mediaId | Media ID of the media which is being downloaded | Valid media ID associated with the given app ID |
Sample Request
curl --location 'https://partner.gupshup.io/partner/app/:appId/media/:mediaId' \
--header 'Authorization: {{PARTNER_APP_TOKEN}}' \
--output {{fileName}}Sample Response
Downloaded media streamStatus Codes
Status Code | Response | Comments |
|---|---|---|
Success | ||
200 | Downloaded media stream | |
Error | ||
400 | { "status":"error","message/data":"Specific to API"} | Error with respect to API |
401 | { "status":"error","message":"Unauthorized Access"} | When authentication fails |
500 | { "status": "error","message": "Internal Server Error"} | For any Internal Error |
