Mobile Push
Easily noticeable and consumable, mobile-first experience.
The Notifly WhatsApp Media API makes it easy to send any WhatsApp-supported media. With this API, you can quickly obtain the media_id
and send media via the WhatsApp Sending API.
The Method Type and API Endpoint are as follows:
POST: /api/notifications/whatsapp/media
The Header for WhatsApp Media api is:
{
"Authorization": "YOUR_TOKEN_HERE"
}
To send a request to the API, the following parameters must be included in the payload.
field | Data type | Description | Required |
---|---|---|---|
file | binary | Media type supported by whatsapp. | Yes |
curl --location 'https://api.getnotifly.io/api/notifications/whatsapp/media' \
--header 'Authorization: "YOUR_TOKEN_HERE" \
--form 'file="video_file_example.mp4"'
Media | Supported Types | Required |
---|---|---|
audio | audio/aac , audio/mp4 , audio/mpeg , audio/amr , audio/ogg (only opus codecs , base audio/ogg is not supported) | 16MB |
document | text/plain , application/pdf , application/vnd.ms-powerpoint , application/msword , application/vnd.ms-excel , application/vnd.openxmlformats-officedocument.wordprocessingml.document , application/vnd.openxmlformats-officedocument.presentationml.presentation , application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | 100MB |
image | image/jpeg , image/png Note: Images must be 8-bit, RGB or RGBA | 5MB |
video | video/mp4 , video/3gp Note: - Only H.264 video codec and AAC audio codec is supported. - We support videos with a single audio stream or no audio stream. | 16MB |
sticker | image/webp | static sticker- 100KB, Animated sticker- 500KB |
When making a request, replace value
with your token. If the request is successful, you will get a JSON response containing the access token.
If the API receives a successful request, it will typically return specific parameters as part of the response:
{
"success": true,
"message": false,
"data": {
"id": "273478495851191"
}
}
field | Data type | Description | Required |
---|---|---|---|
success | boolean | Indicating whether the request was successful or not. | Yes |
message | boolean /string | Informs of additional value if sent along with the response, which can be either false or a string that defines the action done by the API caller. | Yes |
data | object | A JSON object containing information related to the request | Yes |
id | integer | A media_id generated after making an API call. | Yes |
If the media request fails, the API will return specific parameters (HTTP errors) as part of the response:
Error Code | HTTP Status | Cause | Solution |
---|---|---|---|
1319 | 400 | invalid file | Provide a valid file (supported on WhatsApp) |
1354 | 400 | invalid WhatsApp configuration | Configure a valid WhatsApp platform setting on Advantus |