Fully featured binary message
POST – https://{baseUrl}/sms/1/binary/advanced
Send advanced binary SMS with the all available features and parameters.
Response format
On success, response header HTTP status code will be 200 OK and the message will be sent.
If you try to send message without authorization, you will receive an error 401 Unauthorized.
SMSResponse
Parameter
|
Type
|
Description
|
---|---|---|
bulkId
|
String
|
The ID that uniquely identifies the request. Bulk ID will be received only when you send a message to more than one destination address.
|
messages
|
SMSResponseDetails[]
|
Array of sent message objects, one object per every message.
|
SMSResponseDetails
Parameter
|
Type
|
Description
|
---|---|---|
to
|
String
|
The message destination address.
|
status
|
Status
|
Indicates whether the message is successfully sent, not sent, delivered, not delivered, waiting for delivery or any other possible status.
|
smsCount
|
int
|
The number of sent message segments.
|
messageId
|
String
|
The ID that uniquely identifies the message sent.
|
Status
Parameter
|
Type
|
Description
|
---|---|---|
groupId
|
int
|
Status group ID.
|
groupName
|
String
|
Status group name.
|
id
|
int
|
Status ID.
|
name
|
String
|
Status name.
|
description
|
String
|
Human readable description of the status.
|
action
|
String
|
Action that should be taken to eliminate the error.
|
{
"bulkId": "BULK-ID-123-xyz",
"messages": [
{
"binary": {
"dataCoding": 0,
"esmClass": 0,
"hex": "54 65 73 74 20 6d 65 73 73 61 67 65 2e"
},
"callbackData": "DLR callback data",
"destinations": [
{
"messageId": "MESSAGE-ID-123-xyz",
"to": "41793026727"
},
{
"to": "41793026834"
}
],
"from": "SMSC",
"intermediateReport": true,
"notifyContentType": "application/json",
"notifyUrl": "https://www.example.com/sms/advanced",
"validityPeriod": 720
},
{
"binary": {
"dataCoding": 0,
"esmClass": 0,
"hex": "41 20 6C 6F 6E 67 20 74 …20 45 6D 70 69 72 65 2E"
},
"deliveryTimeWindow": {
"days": [
"MONDAY",
"TUESDAY",
"WEDNESDAY",
"THURSDAY",
"FRIDAY",
"SATURDAY",
"SUNDAY"
],
"from": {
"hour": 6,
"minute": 0
},
"to": {
"hour": 15,
"minute": 30
}
},
"destinations": [
{
"to": "41793026700"
}
],
"from": "41793026700",
"sendAt": "2021-08-25T16:00:00.000+0000"
}
]
}
Response 200-Result Example
{
"bulkId": "2034072219640523073",
"messages": [
{
"messageId": "2033247207850523791",
"status": {
"description": "Message sent to next instance",
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "MESSAGE_ACCEPTED"
},
"to": "41793026727"
},
{
"messageId": "2033247207850523792",
"status": {
"description": "Message sent to next instance",
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "MESSAGE_ACCEPTED"
},
"to": "41793026834"
}
]
}
Response 400-Result Example
{
"requestError": {
"serviceException": {
"messageId": "BAD_REQUEST",
"text": "Bad request"
}
}
}
curl -L -X POST 'https://example.com/sms/1/text/advanced' \
-H 'Authorization: {authorization}' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"bulkId": "BULK-ID-123-xyz",
"messages": [
{
"binary": {
"dataCoding": 0,
"esmClass": 0,
"hex": "54 65 73 74 20 6d 65 73 73 61 67 65 2e"
},
"callbackData": "DLR callback data",
"destinations": [
{
"messageId": "MESSAGE-ID-123-xyz",
"to": "41793026727"
},
{
"to": "41793026834"
}
],
"from": "SMSC",
"intermediateReport": true,
"notifyContentType": "application/json",
"notifyUrl": "https://www.example.com/sms/advanced",
"validityPeriod": 720
},
{
"binary": {
"dataCoding": 0,
"esmClass": 0,
"hex": "41 20 6C 6F 6E 67 20 74 …20 45 6D 70 69 72 65 2E"
},
"deliveryTimeWindow": {
"days": [
"MONDAY",
"TUESDAY",
"WEDNESDAY",
"THURSDAY",
"FRIDAY",
"SATURDAY",
"SUNDAY"
],
"from": {
"hour": 6,
"minute": 0
},
"to": {
"hour": 15,
"minute": 30
}
},
"destinations": [
{
"to": "41793026700"
}
],
"from": "41793026700",
"sendAt": "2021-08-25T16:00:00.000+0000"
}
]
}'
Response 200-Result Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"bulkId": "BULK-ID-123-xyz",
"messages": [
{
"to": "41793026727",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "MESSAGE-ID-123-xyz"
},
{
"to": "41793026731",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "2033920598431630183"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033920598431630184"
}
]
}
Response 400-Result Example
{
"requestError": {
"serviceException": {
"messageId": "BAD_REQUEST",
"text": "Bad request"
}
}
}
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'POST',
'hostname': 'example.com',
'path': '/sms/1/binary/advanced',
'headers': {
'Authorization': '{authorization}',
'Content-Type': 'application/json',
'Accept': 'application/json'
},
'maxRedirects': 20
};
var req = https.request(options, function (res) {
var chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function (chunk) {
var body = Buffer.concat(chunks);
console.log(body.toString());
});
res.on("error", function (error) {
console.error(error);
});
});
var postData = JSON.stringify({
"bulkId": "BULK-ID-123-xyz",
"messages": [
{
"binary": {
"dataCoding": 0,
"esmClass": 0,
"hex": "54 65 73 74 20 6d 65 73 73 61 67 65 2e"
},
"callbackData": "DLR callback data",
"destinations": [
{
"messageId": "MESSAGE-ID-123-xyz",
"to": "41793026727"
},
{
"to": "41793026834"
}
],
"from": "SMSC",
"intermediateReport": true,
"notifyContentType": "application/json",
"notifyUrl": "https://www.example.com/sms/advanced",
"validityPeriod": 720
},
{
"binary": {
"dataCoding": 0,
"esmClass": 0,
"hex": "41 20 6C 6F 6E 67 20 74 …20 45 6D 70 69 72 65 2E"
},
"deliveryTimeWindow": {
"days": [
"MONDAY",
"TUESDAY",
"WEDNESDAY",
"THURSDAY",
"FRIDAY",
"SATURDAY",
"SUNDAY"
],
"from": {
"hour": 6,
"minute": 0
},
"to": {
"hour": 15,
"minute": 30
}
},
"destinations": [
{
"to": "41793026700"
}
],
"from": "41793026700",
"sendAt": "2021-08-25T16:00:00.000+0000"
}
]
});
req.write(postData);
req.end();
Response 200-Result Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"bulkId": "BULK-ID-123-xyz",
"messages": [
{
"to": "41793026727",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "MESSAGE-ID-123-xyz"
},
{
"to": "41793026731",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "2033920598431630183"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033920598431630184"
}
]
}
Response 400-Result Example
{
"requestError": {
"serviceException": {
"messageId": "BAD_REQUEST",
"text": "Bad request"
}
}
}
require "uri"
require "json"
require "net/http"
url = URI("https://example.com/sms/1/text/advanced")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = "{authorization}"
request["Content-Type"] = "application/json"
request["Accept"] = "application/json"
request.body = JSON.dump({
"bulkId": "BULK-ID-123-xyz",
"messages": [
{
"binary": {
"dataCoding": 0,
"esmClass": 0,
"hex": "54 65 73 74 20 6d 65 73 73 61 67 65 2e"
},
"callbackData": "DLR callback data",
"destinations": [
{
"messageId": "MESSAGE-ID-123-xyz",
"to": "41793026727"
},
{
"to": "41793026834"
}
],
"from": "SMSC",
"intermediateReport": true,
"notifyContentType": "application/json",
"notifyUrl": "https://www.example.com/sms/advanced",
"validityPeriod": 720
},
{
"binary": {
"dataCoding": 0,
"esmClass": 0,
"hex": "41 20 6C 6F 6E 67 20 74 …20 45 6D 70 69 72 65 2E"
},
"deliveryTimeWindow": {
"days": [
"MONDAY",
"TUESDAY",
"WEDNESDAY",
"THURSDAY",
"FRIDAY",
"SATURDAY",
"SUNDAY"
],
"from": {
"hour": 6,
"minute": 0
},
"to": {
"hour": 15,
"minute": 30
}
},
"destinations": [
{
"to": "41793026700"
}
],
"from": "41793026700",
"sendAt": "2021-08-25T16:00:00.000+0000"
}
]
})
response = https.request(request)
puts response.read_body
Response 200-Result Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"bulkId": "BULK-ID-123-xyz",
"messages": [
{
"to": "41793026727",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "MESSAGE-ID-123-xyz"
},
{
"to": "41793026731",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "2033920598431630183"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033920598431630184"
}
]
}
Response 400-Result Example
{
"requestError": {
"serviceException": {
"messageId": "BAD_REQUEST",
"text": "Bad request"
}
}
}
import http.client
import json
conn = http.client.HTTPSConnection("example.com")
payload = json.dumps({
"bulkId": "BULK-ID-123-xyz",
"messages": [
{
"binary": {
"dataCoding": 0,
"esmClass": 0,
"hex": "54 65 73 74 20 6d 65 73 73 61 67 65 2e"
},
"callbackData": "DLR callback data",
"destinations": [
{
"messageId": "MESSAGE-ID-123-xyz",
"to": "41793026727"
},
{
"to": "41793026834"
}
],
"from": "SMSC",
"intermediateReport": True,
"notifyContentType": "application/json",
"notifyUrl": "https://www.example.com/sms/advanced",
"validityPeriod": 720
},
{
"binary": {
"dataCoding": 0,
"esmClass": 0,
"hex": "41 20 6C 6F 6E 67 20 74 …20 45 6D 70 69 72 65 2E"
},
"deliveryTimeWindow": {
"days": [
"MONDAY",
"TUESDAY",
"WEDNESDAY",
"THURSDAY",
"FRIDAY",
"SATURDAY",
"SUNDAY"
],
"from": {
"hour": 6,
"minute": 0
},
"to": {
"hour": 15,
"minute": 30
}
},
"destinations": [
{
"to": "41793026700"
}
],
"from": "41793026700",
"sendAt": "2021-08-25T16:00:00.000+0000"
}
]
})
headers = {
'Authorization': '{authorization}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
conn.request("POST", "/sms/2/binary/advanced", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Response 200-Result Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"bulkId": "BULK-ID-123-xyz",
"messages": [
{
"to": "41793026727",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "MESSAGE-ID-123-xyz"
},
{
"to": "41793026731",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "2033920598431630183"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033920598431630184"
}
]
}
Response 400-Result Example
{
"requestError": {
"serviceException": {
"messageId": "BAD_REQUEST",
"text": "Bad request"
}
}
}
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://example.com/sms/1/text/advanced',
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 =>'{"bulkId":"BULK-ID-123-xyz","messages":[{"binary":{"dataCoding":0,"esmClass":0,"hex":"54 65 73 74 20 6d 65 73 73 61 67 65 2e"},"callbackData":"DLR callback data","destinations":[{"messageId":"MESSAGE-ID-123-xyz","to":"41793026727"},{"to":"41793026834"}],"from":"SMSC","intermediateReport":true,"notifyContentType":"application/json","notifyUrl":"https://www.example.com/sms/advanced","validityPeriod":720},{"binary":{"dataCoding":0,"esmClass":0,"hex":"41 20 6C 6F 6E 67 20 74 …20 45 6D 70 69 72 65 2E"},"deliveryTimeWindow":{"days":["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"],"from":{"hour":6,"minute":0},"to":{"hour":15,"minute":30}},"destinations":[{"to":"41793026700"}],"from":"41793026700","sendAt":"2021-08-25T16:00:00.000+0000"}]}',
CURLOPT_HTTPHEADER => array(
'Authorization: {authorization}',
'Content-Type: application/json',
'Accept: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
Response 200-Result Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"bulkId": "BULK-ID-123-xyz",
"messages": [
{
"to": "41793026727",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "MESSAGE-ID-123-xyz"
},
{
"to": "41793026731",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "2033920598431630183"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033920598431630184"
}
]
}
Response 400-Result Example
{
"requestError": {
"serviceException": {
"messageId": "BAD_REQUEST",
"text": "Bad request"
}
}
}
var client = new RestClient("https://example.com/sms/1/text/advanced");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "{authorization}");
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Accept", "application/json");
var body = @"{""bulkId"":""BULK-ID-123-xyz"",""messages"":[{""binary"":{""dataCoding"":0,""esmClass"":0,""hex"":""54 65 73 74 20 6d 65 73 73 61 67 65 2e""},""callbackData"":""DLR callback data"",""destinations"":[{""messageId"":""MESSAGE-ID-123-xyz"",""to"":""41793026727""},{""to"":""41793026834""}],""from"":""SMSC"",""intermediateReport"":true,""notifyContentType"":""application/json"",""notifyUrl"":""https://www.example.com/sms/advanced"",""validityPeriod"":720},{""binary"":{""dataCoding"":0,""esmClass"":0,""hex"":""41 20 6C 6F 6E 67 20 74 …20 45 6D 70 69 72 65 2E""},""deliveryTimeWindow"":{""days"":[""MONDAY"",""TUESDAY"",""WEDNESDAY"",""THURSDAY"",""FRIDAY"",""SATURDAY"",""SUNDAY""],""from"":{""hour"":6,""minute"":0},""to"":{""hour"":15,""minute"":30}},""destinations"":[{""to"":""41793026700""}],""from"":""41793026700"",""sendAt"":""2021-08-25T16:00:00.000+0000""}]}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Response 200-Result Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"bulkId": "BULK-ID-123-xyz",
"messages": [
{
"to": "41793026727",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "MESSAGE-ID-123-xyz"
},
{
"to": "41793026731",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "2033920598431630183"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033920598431630184"
}
]
}
Response 400-Result Example
{
"requestError": {
"serviceException": {
"messageId": "BAD_REQUEST",
"text": "Bad request"
}
}
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"bulkId\":\"BULK-ID-123-xyz\",\"messages\":[{\"binary\":{\"dataCoding\":0,\"esmClass\":0,\"hex\":\"54 65 73 74 20 6d 65 73 73 61 67 65 2e\"},\"callbackData\":\"DLR callback data\",\"destinations\":[{\"messageId\":\"MESSAGE-ID-123-xyz\",\"to\":\"41793026727\"},{\"to\":\"41793026834\"}],\"from\":\"SMSC\",\"intermediateReport\":true,\"notifyContentType\":\"application/json\",\"notifyUrl\":\"https://www.example.com/sms/advanced\",\"validityPeriod\":720},{\"binary\":{\"dataCoding\":0,\"esmClass\":0,\"hex\":\"41 20 6C 6F 6E 67 20 74 …20 45 6D 70 69 72 65 2E\"},\"deliveryTimeWindow\":{\"days\":[\"MONDAY\",\"TUESDAY\",\"WEDNESDAY\",\"THURSDAY\",\"FRIDAY\",\"SATURDAY\",\"SUNDAY\"],\"from\":{\"hour\":6,\"minute\":0},\"to\":{\"hour\":15,\"minute\":30}},\"destinations\":[{\"to\":\"41793026700\"}],\"from\":\"41793026700\",\"sendAt\":\"2021-08-25T16:00:00.000+0000\"}]}");
Request request = new Request.Builder()
.url("https://example.com/sms/1/text/advanced")
.method("POST", body)
.addHeader("Authorization", "{authorization}")
.addHeader("Content-Type", "application/json")
.addHeader("Accept", "application/json")
.build();
Response response = client.newCall(request).execute();
Response 200-Result Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"bulkId": "BULK-ID-123-xyz",
"messages": [
{
"to": "41793026727",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "MESSAGE-ID-123-xyz"
},
{
"to": "41793026731",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "2033920598431630183"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033920598431630184"
}
]
}
Response 400-Result Example
{
"requestError": {
"serviceException": {
"messageId": "BAD_REQUEST",
"text": "Bad request"
}
}
}
var settings = {
"url": "https://example.com/sms/1/text/advanced",
"method": "POST",
"timeout": 0,
"headers": {
"Authorization": "{authorization}",
"Content-Type": "application/json",
"Accept": "application/json"
},
"data": JSON.stringify({
"bulkId": "BULK-ID-123-xyz",
"messages": [
{
"binary": {
"dataCoding": 0,
"esmClass": 0,
"hex": "54 65 73 74 20 6d 65 73 73 61 67 65 2e"
},
"callbackData": "DLR callback data",
"destinations": [
{
"messageId": "MESSAGE-ID-123-xyz",
"to": "41793026727"
},
{
"to": "41793026834"
}
],
"from": "SMSC",
"intermediateReport": true,
"notifyContentType": "application/json",
"notifyUrl": "https://www.example.com/sms/advanced",
"validityPeriod": 720
},
{
"binary": {
"dataCoding": 0,
"esmClass": 0,
"hex": "41 20 6C 6F 6E 67 20 74 …20 45 6D 70 69 72 65 2E"
},
"deliveryTimeWindow": {
"days": [
"MONDAY",
"TUESDAY",
"WEDNESDAY",
"THURSDAY",
"FRIDAY",
"SATURDAY",
"SUNDAY"
],
"from": {
"hour": 6,
"minute": 0
},
"to": {
"hour": 15,
"minute": 30
}
},
"destinations": [
{
"to": "41793026700"
}
],
"from": "41793026700",
"sendAt": "2021-08-25T16:00:00.000+0000"
}
]
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
Response 200-Result Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"bulkId": "BULK-ID-123-xyz",
"messages": [
{
"to": "41793026727",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "MESSAGE-ID-123-xyz"
},
{
"to": "41793026731",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "2033920598431630183"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033920598431630184"
}
]
}
Response 400-Result Example
{
"requestError": {
"serviceException": {
"messageId": "BAD_REQUEST",
"text": "Bad request"
}
}
}
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/sms/1/text/advanced"
method := "POST"
payload := strings.NewReader(`{"bulkId":"BULK-ID-123-xyz","messages":[{"binary":{"dataCoding":0,"esmClass":0,"hex":"54 65 73 74 20 6d 65 73 73 61 67 65 2e"},"callbackData":"DLR callback data","destinations":[{"messageId":"MESSAGE-ID-123-xyz","to":"41793026727"},{"to":"41793026834"}],"from":"SMSC","intermediateReport":true,"notifyContentType":"application/json","notifyUrl":"https://www.example.com/sms/advanced","validityPeriod":720},{"binary":{"dataCoding":0,"esmClass":0,"hex":"41 20 6C 6F 6E 67 20 74 …20 45 6D 70 69 72 65 2E"},"deliveryTimeWindow":{"days":["MONDAY","TUESDAY","WEDNESDAY","THURSDAY","FRIDAY","SATURDAY","SUNDAY"],"from":{"hour":6,"minute":0},"to":{"hour":15,"minute":30}},"destinations":[{"to":"41793026700"}],"from":"41793026700","sendAt":"2021-08-25T16:00:00.000+0000"}]}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "{authorization}")
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Accept", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
Response 200-Result Example
HTTP/1.1 200 OK
Content-Type: application/json
{
"bulkId": "BULK-ID-123-xyz",
"messages": [
{
"to": "41793026727",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "MESSAGE-ID-123-xyz"
},
{
"to": "41793026731",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 7,
"name": "PENDING_ENROUTE",
"description": "Message sent to next instance"
},
"smsCount": 1,
"messageId": "2033920598431630183"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033920598431630184"
}
]
}
Response 400-Result Example
{
"requestError": {
"serviceException": {
"messageId": "BAD_REQUEST",
"text": "Bad request"
}
}
}