Send a message
curl --request POST \
--url https://shortext.ny-corp.io/api/messages/send \
--header 'Authorization: Bearer <token>' \
--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
}
}
}
'import requests
url = "https://shortext.ny-corp.io/api/messages/send"
payload = {
"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
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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}}
})
};
fetch('https://shortext.ny-corp.io/api/messages/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://shortext.ny-corp.io/api/messages/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://shortext.ny-corp.io/api/messages/send"
payload := strings.NewReader("{\n \"channel\": \"whatsapp\",\n \"contact\": {\n \"phone\": \"1234567890\",\n \"profile\": {\n \"lastname\": \"Yoan\",\n \"firstname\": \"André\",\n \"email\": \"celia@home.io\",\n \"address\": \"Place to be\",\n \"preferred_language\": \"en\"\n }\n },\n \"from\": \"1234567890\",\n \"message\": {\n \"type\": \"text\",\n \"content\": {\n \"text\": \"Ceci est un message texte.\",\n \"preview_url\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://shortext.ny-corp.io/api/messages/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel\": \"whatsapp\",\n \"contact\": {\n \"phone\": \"1234567890\",\n \"profile\": {\n \"lastname\": \"Yoan\",\n \"firstname\": \"André\",\n \"email\": \"celia@home.io\",\n \"address\": \"Place to be\",\n \"preferred_language\": \"en\"\n }\n },\n \"from\": \"1234567890\",\n \"message\": {\n \"type\": \"text\",\n \"content\": {\n \"text\": \"Ceci est un message texte.\",\n \"preview_url\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://shortext.ny-corp.io/api/messages/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel\": \"whatsapp\",\n \"contact\": {\n \"phone\": \"1234567890\",\n \"profile\": {\n \"lastname\": \"Yoan\",\n \"firstname\": \"André\",\n \"email\": \"celia@home.io\",\n \"address\": \"Place to be\",\n \"preferred_language\": \"en\"\n }\n },\n \"from\": \"1234567890\",\n \"message\": {\n \"type\": \"text\",\n \"content\": {\n \"text\": \"Ceci est un message texte.\",\n \"preview_url\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": "true",
"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"
}
}Messages
Send Message
Envoie un message au destinataire via l’API Shortext
POST
/
messages
/
send
Send a message
curl --request POST \
--url https://shortext.ny-corp.io/api/messages/send \
--header 'Authorization: Bearer <token>' \
--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
}
}
}
'import requests
url = "https://shortext.ny-corp.io/api/messages/send"
payload = {
"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
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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}}
})
};
fetch('https://shortext.ny-corp.io/api/messages/send', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://shortext.ny-corp.io/api/messages/send",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'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
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://shortext.ny-corp.io/api/messages/send"
payload := strings.NewReader("{\n \"channel\": \"whatsapp\",\n \"contact\": {\n \"phone\": \"1234567890\",\n \"profile\": {\n \"lastname\": \"Yoan\",\n \"firstname\": \"André\",\n \"email\": \"celia@home.io\",\n \"address\": \"Place to be\",\n \"preferred_language\": \"en\"\n }\n },\n \"from\": \"1234567890\",\n \"message\": {\n \"type\": \"text\",\n \"content\": {\n \"text\": \"Ceci est un message texte.\",\n \"preview_url\": true\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://shortext.ny-corp.io/api/messages/send")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"channel\": \"whatsapp\",\n \"contact\": {\n \"phone\": \"1234567890\",\n \"profile\": {\n \"lastname\": \"Yoan\",\n \"firstname\": \"André\",\n \"email\": \"celia@home.io\",\n \"address\": \"Place to be\",\n \"preferred_language\": \"en\"\n }\n },\n \"from\": \"1234567890\",\n \"message\": {\n \"type\": \"text\",\n \"content\": {\n \"text\": \"Ceci est un message texte.\",\n \"preview_url\": true\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://shortext.ny-corp.io/api/messages/send")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"channel\": \"whatsapp\",\n \"contact\": {\n \"phone\": \"1234567890\",\n \"profile\": {\n \"lastname\": \"Yoan\",\n \"firstname\": \"André\",\n \"email\": \"celia@home.io\",\n \"address\": \"Place to be\",\n \"preferred_language\": \"en\"\n }\n },\n \"from\": \"1234567890\",\n \"message\": {\n \"type\": \"text\",\n \"content\": {\n \"text\": \"Ceci est un message texte.\",\n \"preview_url\": true\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"success": "true",
"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"
}
}- Text
- Interactive Button Reply
- Interactive List Messages
- Third Tab
- Third Tab
Text messages are messages containing only a text body and an optional link preview.

Text Message
Link Preview
You can have the WhatsApp client attempt to render a preview of the first URL in the body text string, if it contains one. URLs must begin with http:// or https://. If multiple URLs are in the body text string, only the first URL will be rendered.If omitted, or if unable to retrieve a link preview, a clickable link will be rendered instead.
Interactive Button Reply
Interactive reply buttons messages allow you to send up to three predefined replies for users to choose from.

User respond to interactive button
Users can respond to a message by selecting one of the predefined buttons, which triggers a messages webhook describing their selection.

Interactive Button Reply
Interactive list messages allow you to present WhatsApp users with a list of options to choose from (options are defined as rows in the request payload):

User respond to interactive button
When a user taps the button in the message, it displays a modal that lists the options available:

User respond to interactive button
Users can then choose one option and their selection will be sent as a reply:

Interactive list messages support up to 10 sections, with up to 10 rows per section, and can include an optional header and footer.
💪 Here’s content that’s only inside the third Tab.
💪 Here’s content that’s only inside the third Tab.
Authorizations
Basic Auth
Body
application/json
⌘I