Sending messages
Send multiple messages
POST
/
messages
Send multiple messages
curl --request POST \
--url https://api.smsmngr.com/v1/messages \
--header 'Content-Type: application/json' \
--data '
[
{
"body": "<string>",
"to": [
{
"phone_number": "<string>"
}
],
"callback": "<string>",
"tag": "promotional",
"datetime": "2023-11-07T05:31:56Z",
"delivery_time": {
"days": [],
"start": "<string>",
"end": "<string>"
},
"flow": [
{}
],
"payload": {}
}
]
'import requests
url = "https://api.smsmngr.com/v1/messages"
payload = [
{
"body": "<string>",
"to": [{ "phone_number": "<string>" }],
"callback": "<string>",
"tag": "promotional",
"datetime": "2023-11-07T05:31:56Z",
"delivery_time": {
"days": [],
"start": "<string>",
"end": "<string>"
},
"flow": [{}],
"payload": {}
}
]
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([
{
body: JSON.stringify('<string>'),
to: [{phone_number: '<string>'}],
callback: '<string>',
tag: 'promotional',
datetime: '2023-11-07T05:31:56Z',
delivery_time: {days: [], start: '<string>', end: '<string>'},
flow: [{}],
payload: {}
}
])
};
fetch('https://api.smsmngr.com/v1/messages', 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://api.smsmngr.com/v1/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([
[
'body' => '<string>',
'to' => [
[
'phone_number' => '<string>'
]
],
'callback' => '<string>',
'tag' => 'promotional',
'datetime' => '2023-11-07T05:31:56Z',
'delivery_time' => [
'days' => [
],
'start' => '<string>',
'end' => '<string>'
],
'flow' => [
[
]
],
'payload' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"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://api.smsmngr.com/v1/messages"
payload := strings.NewReader("[\n {\n \"body\": \"<string>\",\n \"to\": [\n {\n \"phone_number\": \"<string>\"\n }\n ],\n \"callback\": \"<string>\",\n \"tag\": \"promotional\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"delivery_time\": {\n \"days\": [],\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"flow\": [\n {}\n ],\n \"payload\": {}\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
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://api.smsmngr.com/v1/messages")
.header("Content-Type", "application/json")
.body("[\n {\n \"body\": \"<string>\",\n \"to\": [\n {\n \"phone_number\": \"<string>\"\n }\n ],\n \"callback\": \"<string>\",\n \"tag\": \"promotional\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"delivery_time\": {\n \"days\": [],\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"flow\": [\n {}\n ],\n \"payload\": {}\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smsmngr.com/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"body\": \"<string>\",\n \"to\": [\n {\n \"phone_number\": \"<string>\"\n }\n ],\n \"callback\": \"<string>\",\n \"tag\": \"promotional\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"delivery_time\": {\n \"days\": [],\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"flow\": [\n {}\n ],\n \"payload\": {}\n }\n]"
response = http.request(request)
puts response.read_body{
"requestId": "<string>",
"accepted": [
{
"key": "<string>",
"messageId": "<string>"
}
],
"rejected": [
{
"key": "<string>"
}
]
}{
"Message": "User is not authorized to access this resource with an explicit deny"
}Body
application/json
Required array length:
1 - 10 elementsThe message body (if not defined in the flow).
Maximum string length:
1000List of recipients.
Required array length:
1 - 10 elementsShow child attributes
Show child attributes
Callback URL for delivery notifications.
Tag for the message. You can use it to group messages (e.g. by campaign id). There are also some special tags you can use: priority (for priority messages), transactional (for transactional messages).
Scheduled time for sending the message. Always in UTC timezone.
Example:
"2025-01-11T10:00:00.000Z"
Show child attributes
Show child attributes
A list of communication channels for the message flow. If defined, must not be empty.
Show child attributes
Show child attributes
Customizable object You can even create for the message, where you can define any parameters for the message. This object is returned in the delivery notification and replies.
Example:
{ "value": { "user_id": "123456" } }
⌘I
Send multiple messages
curl --request POST \
--url https://api.smsmngr.com/v1/messages \
--header 'Content-Type: application/json' \
--data '
[
{
"body": "<string>",
"to": [
{
"phone_number": "<string>"
}
],
"callback": "<string>",
"tag": "promotional",
"datetime": "2023-11-07T05:31:56Z",
"delivery_time": {
"days": [],
"start": "<string>",
"end": "<string>"
},
"flow": [
{}
],
"payload": {}
}
]
'import requests
url = "https://api.smsmngr.com/v1/messages"
payload = [
{
"body": "<string>",
"to": [{ "phone_number": "<string>" }],
"callback": "<string>",
"tag": "promotional",
"datetime": "2023-11-07T05:31:56Z",
"delivery_time": {
"days": [],
"start": "<string>",
"end": "<string>"
},
"flow": [{}],
"payload": {}
}
]
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify([
{
body: JSON.stringify('<string>'),
to: [{phone_number: '<string>'}],
callback: '<string>',
tag: 'promotional',
datetime: '2023-11-07T05:31:56Z',
delivery_time: {days: [], start: '<string>', end: '<string>'},
flow: [{}],
payload: {}
}
])
};
fetch('https://api.smsmngr.com/v1/messages', 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://api.smsmngr.com/v1/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([
[
'body' => '<string>',
'to' => [
[
'phone_number' => '<string>'
]
],
'callback' => '<string>',
'tag' => 'promotional',
'datetime' => '2023-11-07T05:31:56Z',
'delivery_time' => [
'days' => [
],
'start' => '<string>',
'end' => '<string>'
],
'flow' => [
[
]
],
'payload' => [
]
]
]),
CURLOPT_HTTPHEADER => [
"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://api.smsmngr.com/v1/messages"
payload := strings.NewReader("[\n {\n \"body\": \"<string>\",\n \"to\": [\n {\n \"phone_number\": \"<string>\"\n }\n ],\n \"callback\": \"<string>\",\n \"tag\": \"promotional\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"delivery_time\": {\n \"days\": [],\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"flow\": [\n {}\n ],\n \"payload\": {}\n }\n]")
req, _ := http.NewRequest("POST", url, payload)
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://api.smsmngr.com/v1/messages")
.header("Content-Type", "application/json")
.body("[\n {\n \"body\": \"<string>\",\n \"to\": [\n {\n \"phone_number\": \"<string>\"\n }\n ],\n \"callback\": \"<string>\",\n \"tag\": \"promotional\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"delivery_time\": {\n \"days\": [],\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"flow\": [\n {}\n ],\n \"payload\": {}\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.smsmngr.com/v1/messages")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"body\": \"<string>\",\n \"to\": [\n {\n \"phone_number\": \"<string>\"\n }\n ],\n \"callback\": \"<string>\",\n \"tag\": \"promotional\",\n \"datetime\": \"2023-11-07T05:31:56Z\",\n \"delivery_time\": {\n \"days\": [],\n \"start\": \"<string>\",\n \"end\": \"<string>\"\n },\n \"flow\": [\n {}\n ],\n \"payload\": {}\n }\n]"
response = http.request(request)
puts response.read_body{
"requestId": "<string>",
"accepted": [
{
"key": "<string>",
"messageId": "<string>"
}
],
"rejected": [
{
"key": "<string>"
}
]
}{
"Message": "User is not authorized to access this resource with an explicit deny"
}