Download incoming media
curl --request POST \
--url https://core.wadial.com/api/v1/sessions/{sessionId}/media/download \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://core.wadial.com/api/v1/sessions/{sessionId}/media/download', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://core.wadial.com/api/v1/sessions/{sessionId}/media/download"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)API Reference
Download incoming media
Download an incoming image, video, audio, document, or sticker attachment.
POST
/
api
/
v1
/
sessions
/
{sessionId}
/
media
/
download
Download incoming media
curl --request POST \
--url https://core.wadial.com/api/v1/sessions/{sessionId}/media/download \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://core.wadial.com/api/v1/sessions/{sessionId}/media/download', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://core.wadial.com/api/v1/sessions/{sessionId}/media/download"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)Use this endpoint after receiving an incoming media message from webhooks or the event stream. Pass the incoming
If the message has no downloadable attachment, the API returns a Problem Details validation error.
message object from the event payload.
POST /api/v1/sessions/{sessionId}/media/download
Authorization: Bearer <api_key>
Content-Type: application/json
{
"message": {
"imageMessage": {
"mimetype": "image/jpeg",
"directPath": "/v/t62.7118-24/...",
"mediaKey": "..."
}
},
"maxBytes": 16777216
}
maxBytes is optional and defaults to 16 MiB. The maximum accepted value is 64 MiB.
Successful responses return base64-encoded media bytes:
{
"data": {
"mediaType": "image",
"mimetype": "image/jpeg",
"fileLength": 184204,
"sizeBytes": 184204,
"base64": "..."
}
}
Was this page helpful?