Send Text Message
Used to send a message on the WhatsApp channel.
You can send text messages only if the service conversation is open. Check the conversation guides.
Body
Parameter
Required
Values / Type
Notes
message_type
Yes
text
client
Yes
String
Mandatory, ID of the client to whom the message is sent.
text_message
No*
String
Mandatory only if message_type:text.
delay
No*
String
Delay in sending the message. The valid format is described in the table below.
Delay Format
Description
Example
2 weeks
2w
2 days
2d
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: ••••••' \
--data '{
"message_type": "text",
"client": "client_id",
"client_phone": "3931212321",
"client_name": "Jon doe",
"text_message": "Text message to send",
"delay": "1m"
}'const axios = require('axios');
let data = JSON.stringify({
"message_type": "text",
"client": "client_id or client_phone are required",
"client_phone": "3932123213",
"client_name": "Jon Doe",
"text_message": "Text Message to send",
"delay": "1m"
});
let config = {
method: 'post',
url: 'https://api.pingueen.it/ext/v2/<BUSINESSNAME>/messages',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer SECREY_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.pingueen.it/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": "text",
"client": "client_id or client_phone are required",
"client_phone": "3932131233",
"client_name": "Jon Doe",
"text_message": "Text message to send",
"delay": "1m"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'Authorization: ••••••'
),
));
$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