Envoie un SMS à un numéro, ou un envoi groupé (`type: bulk`) à des numéros, des groupes de contacts ou un fichier : réserve, met en file, répond sans attendre
curl --request POST \
--url https://api.dexnotify.com/api/v1/sms/messages \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"sender": "<string>",
"to": "<string>",
"type": "single",
"content": "<string>",
"scheduledAt": "<string>",
"timezone": "Africa/Dakar",
"templateId": "<string>",
"variables": {}
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sender: '<string>',
to: '<string>',
type: 'single',
content: '<string>',
scheduledAt: '<string>',
timezone: 'Africa/Dakar',
templateId: '<string>',
variables: {}
})
};
fetch('https://api.dexnotify.com/api/v1/sms/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dexnotify.com/api/v1/sms/messages"
payload = {
"sender": "<string>",
"to": "<string>",
"type": "single",
"content": "<string>",
"scheduledAt": "<string>",
"timezone": "Africa/Dakar",
"templateId": "<string>",
"variables": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dexnotify.com/api/v1/sms/messages",
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([
'sender' => '<string>',
'to' => '<string>',
'type' => 'single',
'content' => '<string>',
'scheduledAt' => '<string>',
'timezone' => 'Africa/Dakar',
'templateId' => '<string>',
'variables' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}SMS
Envoie un SMS à un numéro
Envoie un SMS à un numéro, ou un envoi groupé (type: bulk) à des numéros, des groupes de contacts ou un fichier : réserve, met en file, répond sans attendre
POST
/
api
/
v1
/
sms
/
messages
Envoie un SMS à un numéro, ou un envoi groupé (`type: bulk`) à des numéros, des groupes de contacts ou un fichier : réserve, met en file, répond sans attendre
curl --request POST \
--url https://api.dexnotify.com/api/v1/sms/messages \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"sender": "<string>",
"to": "<string>",
"type": "single",
"content": "<string>",
"scheduledAt": "<string>",
"timezone": "Africa/Dakar",
"templateId": "<string>",
"variables": {}
}
'const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
sender: '<string>',
to: '<string>',
type: 'single',
content: '<string>',
scheduledAt: '<string>',
timezone: 'Africa/Dakar',
templateId: '<string>',
variables: {}
})
};
fetch('https://api.dexnotify.com/api/v1/sms/messages', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dexnotify.com/api/v1/sms/messages"
payload = {
"sender": "<string>",
"to": "<string>",
"type": "single",
"content": "<string>",
"scheduledAt": "<string>",
"timezone": "Africa/Dakar",
"templateId": "<string>",
"variables": {}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.dexnotify.com/api/v1/sms/messages",
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([
'sender' => '<string>',
'to' => '<string>',
'type' => 'single',
'content' => '<string>',
'scheduledAt' => '<string>',
'timezone' => 'Africa/Dakar',
'templateId' => '<string>',
'variables' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}Authorizations
Clé API du projet, créée dans le dashboard (Développeurs › Clés API et SDK). Une clé dxn_prod_ vise la production, une clé dxn_stag_ le staging.
Headers
Clé de rejeu propre à un projet et à un environnement. Rejouée avec la même demande, elle rend le même envoi : un seul message, une seule réservation, un seul job. Employée pour un autre envoi, elle est refusée en 409.
Required string length:
8 - 255Body
application/json
Response
202
Envoi accepté (queued), unités réservées