Send Media Message
Used to send a media message on the WhatsApp channel.
You can send text messages only if the service conversation is open. Check the conversation guides.
Body
message_type
Yes
document, image, template
client
Yes
String
Mandatory, ID of the client to whom the message is sent.
media.file_url
Yes
String
Mandatory forr message_type:document and message_type:image.
media.filename
No*
String
Mandatory only if message_type:document and message_type:image. File extension is always required.
delay
No*
String
Delay in sending the message. The valid format is described in the table below.
Delay Format
Description
Example
1 year
1y
3 months
3M
2 weeks
2w
200 days
200d
14 hours
14h
60 seconds
60s
Endpoint
POST: https://api.pingup.ai/ext/v2/{businessname}}messagesRequest
curl --location 'https://api.pingup.ai/ext/v2/{businessname}/messages' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer SECRET_KEY' \
--data '{
"message_type": "image",
"client": "client_id or client_phone are required ",
"client_phone": "39 321123213",
"client_name": "Jon Doe",
"media": {
"file_url": "https://media.etihub.it/lorecate/7961a729-70f4-4a23-8a01-0f470de87f69.jpg",
"filename": "file.jpg"
},
"delay": "1m"
}'const axios = require('axios');
let data = JSON.stringify({
"message_type": "image",
"client": "client_id or client_phone are required ",
"client_phone": "39 321123213",
"client_name": "Jon Doe",
"media": {
"file_url": "https://media.etihub.it/lorecate/7961a729-70f4-4a23-8a01-0f470de87f69.jpg",
"filename": "file.jpg"
},
"delay": "1m"
});
let config = {
method: 'post',
url: 'https://api.pingup.ai/ext/v2/{businessname}/messages',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer Secret_KEY'
},
data : data
};
```
let response = await axios.request(config);
console.log(response.data);
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://api.pingup.ai/ext/v2/{businessname}/messages',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"message_type": "image",
"client": "client_id or client_phone are required ",
"client_phone": "39 321123213",
"client_name": "Jon Doe",
"media": {
"file_url": "https://media.etihub.it/lorecate/7961a729-70f4-4a23-8a01-0f470de87f69.jpg",
"filename": "file.jpg"
},
"delay": "1m"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: Bearer SECREY_KEY'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response
The value message_id will be sent in the callback to recognize whether a message has been received/read or has failed.
{
"success": true|false,
"data": {
"message_id": "message_id"
}
}Last updated