Messages
Send a message
Messages
Send a message
Envoie un message au destinataire via l’API Shortext
POST
/
messages
/
send
curl --request POST \
--url https://shortext.ny-corp.io/api/messages/send \
--header 'Content-Type: application/json' \
--data '{
"channel": "whatsapp",
"contact": {
"phone": "1234567890",
"profile": {
"lastname": "Yoan",
"firstname": "André",
"email": "celia@home.io",
"address": "Place to be",
"preferred_language": "en"
}
},
"from": "1234567890",
"message": {
"type": "text",
"content": {
"text": "Ceci est un message texte.",
"preview_url": true
}
}
}'
{
"status": "success",
"message_id": "abc123",
"recipient": {
"phone_number": "1234567890"
},
"data": {
"sent_at": "2024-10-05T10:01:00Z",
"delivered_at": "2024-10-05T10:05:00Z",
"read_at": "2024-10-05T10:07:00Z"
}
}
Body
application/json
Available options:
whatsapp
For channel whatsapp -> E.164 format without leading +
Example:
"1234567890"
the id of the sender business number
Example:
"1234567890"
Available options:
text
, media
, interactive
, template
Example:
"text"
WhatsApp allow text message only when there is already an open session between the contact and the business number
for embedded url please use this format ex: https://shortext.io
Maximum length:
4096
Example:
"Ceci est un message texte."
Example:
true
Response
200 - application/json
ButtonReplyMessage sent successfully
Example:
"success"
Example:
"abc123"
curl --request POST \
--url https://shortext.ny-corp.io/api/messages/send \
--header 'Content-Type: application/json' \
--data '{
"channel": "whatsapp",
"contact": {
"phone": "1234567890",
"profile": {
"lastname": "Yoan",
"firstname": "André",
"email": "celia@home.io",
"address": "Place to be",
"preferred_language": "en"
}
},
"from": "1234567890",
"message": {
"type": "text",
"content": {
"text": "Ceci est un message texte.",
"preview_url": true
}
}
}'
{
"status": "success",
"message_id": "abc123",
"recipient": {
"phone_number": "1234567890"
},
"data": {
"sent_at": "2024-10-05T10:01:00Z",
"delivered_at": "2024-10-05T10:05:00Z",
"read_at": "2024-10-05T10:07:00Z"
}
}