Fully featured textual message
POST – https://{baseUrl}/sms/1/text/advanced
Send advanced 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": [
{
"callbackData": "DLR callback data",
"destinations": [
{
"messageId": "MESSAGE-ID-123-xyz",
"to": "41793026727"
},
{
"to": "41793026834"
}
],
"flash": false,
"from": "SMSC",
"intermediateReport": true,
"language": {
"languageCode": "TR"
},
"notifyContentType": "application/json",
"notifyUrl": "https://www.example.com/sms/advanced",
"text": "Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.",
"transliteration": "TURKISH",
"validityPeriod": 720
},
{
"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",
"text": "A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire."
}
],
"tracking": {
"track": "SMS",
"type": "MY_CAMPAIGN"
}
}
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": [
{
"callbackData": "DLR callback data",
"destinations": [
{
"messageId": "MESSAGE-ID-123-xyz",
"to": "41793026727"
},
{
"to": "41793026834"
}
],
"flash": false,
"from": "SMSC",
"intermediateReport": true,
"language": {
"languageCode": "TR"
},
"notifyContentType": "application/json",
"notifyUrl": "https://www.example.com/sms/advanced",
"text": "Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.",
"transliteration": "TURKISH",
"validityPeriod": 720
},
{
"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",
"text": "A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire."
}
],
"tracking": {
"track": "SMS",
"type": "MY_CAMPAIGN"
}
}'
Response 200-Result Example
{
"bulkId": "BULK-ID-123-xyz",
"trackingProcessKey": "9243E3F4BEDC719D83C2A38A483E6CB3",
"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": "2033912860760522207"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033912860760522208"
}
]
}
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/text/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": [
{
"callbackData": "DLR callback data",
"destinations": [
{
"messageId": "MESSAGE-ID-123-xyz",
"to": "41793026727"
},
{
"to": "41793026834"
}
],
"flash": false,
"from": "SMSC",
"intermediateReport": true,
"language": {
"languageCode": "TR"
},
"notifyContentType": "application/json",
"notifyUrl": "https://www.example.com/sms/advanced",
"text": "Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.",
"transliteration": "TURKISH",
"validityPeriod": 720
},
{
"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",
"text": "A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire."
}
],
"tracking": {
"track": "SMS",
"type": "MY_CAMPAIGN"
}
});
req.write(postData);
req.end();
Response 200-Result Example
{
"bulkId": "BULK-ID-123-xyz",
"trackingProcessKey": "9243E3F4BEDC719D83C2A38A483E6CB3",
"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": "2033912860760522207"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033912860760522208"
}
]
}
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": [
{
"callbackData": "DLR callback data",
"destinations": [
{
"messageId": "MESSAGE-ID-123-xyz",
"to": "41793026727"
},
{
"to": "41793026834"
}
],
"flash": false,
"from": "SMSC",
"intermediateReport": true,
"language": {
"languageCode": "TR"
},
"notifyContentType": "application/json",
"notifyUrl": "https://www.example.com/sms/advanced",
"text": "Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.",
"transliteration": "TURKISH",
"validityPeriod": 720
},
{
"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",
"text": "A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire."
}
],
"tracking": {
"track": "SMS",
"type": "MY_CAMPAIGN"
}
})
response = https.request(request)
puts response.read_body
Response 200-Result Example
{
"bulkId": "BULK-ID-123-xyz",
"trackingProcessKey": "9243E3F4BEDC719D83C2A38A483E6CB3",
"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": "2033912860760522207"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033912860760522208"
}
]
}
Response 400-Result Example
{
"requestError": {
"serviceException": {
"messageId": "BAD_REQUEST",
"text": "Bad request"
}
}
}
Installation: $ python -m pip install requests
import http.client
import json
conn = http.client.HTTPSConnection("example.com")
payload = json.dumps({
"bulkId": "BULK-ID-123-xyz",
"messages": [
{
"callbackData": "DLR callback data",
"destinations": [
{
"messageId": "MESSAGE-ID-123-xyz",
"to": "41793026727"
},
{
"to": "41793026834"
}
],
"flash": False,
"from": "SMSC",
"intermediateReport": True,
"language": {
"languageCode": "TR"
},
"notifyContentType": "application/json",
"notifyUrl": "https://www.example.com/sms/advanced",
"text": "Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.",
"transliteration": "TURKISH",
"validityPeriod": 720
},
{
"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",
"text": "A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire."
}
],
"tracking": {
"track": "SMS",
"type": "MY_CAMPAIGN"
}
})
headers = {
'Authorization': '{authorization}',
'Content-Type': 'application/json',
'Accept': 'application/json'
}
conn.request("POST", "/sms/1/text/advanced", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
Response 200-Result Example
{
"bulkId": "BULK-ID-123-xyz",
"trackingProcessKey": "9243E3F4BEDC719D83C2A38A483E6CB3",
"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": "2033912860760522207"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033912860760522208"
}
]
}
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":[{"callbackData":"DLR callback data","destinations":[{"messageId":"MESSAGE-ID-123-xyz","to":"41793026727"},{"to":"41793026834"}],"flash":false,"from":"SMSC","intermediateReport":true,"language":{"languageCode":"TR"},"notifyContentType":"application/json","notifyUrl":"https://www.example.com/sms/advanced","text":"Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.","transliteration":"TURKISH","validityPeriod":720},{"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","text":"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire."}],"tracking":{"track":"SMS","type":"MY_CAMPAIGN"}}',
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
{
"bulkId": "BULK-ID-123-xyz",
"trackingProcessKey": "9243E3F4BEDC719D83C2A38A483E6CB3",
"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": "2033912860760522207"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033912860760522208"
}
]
}
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"":[{""callbackData"":""DLR callback data"",""destinations"":[{""messageId"":""MESSAGE-ID-123-xyz"",""to"":""41793026727""},{""to"":""41793026834""}],""flash"":false,""from"":""SMSC"",""intermediateReport"":true,""language"":{""languageCode"":""TR""},""notifyContentType"":""application/json"",""notifyUrl"":""https://www.example.com/sms/advanced"",""text"":""Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz."",""transliteration"":""TURKISH"",""validityPeriod"":720},{""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"",""text"":""A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.""}],""tracking"":{""track"":""SMS"",""type"":""MY_CAMPAIGN""}}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
Response 200-Result Example
{
"bulkId": "BULK-ID-123-xyz",
"trackingProcessKey": "9243E3F4BEDC719D83C2A38A483E6CB3",
"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": "2033912860760522207"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033912860760522208"
}
]
}
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\":[{\"callbackData\":\"DLR callback data\",\"destinations\":[{\"messageId\":\"MESSAGE-ID-123-xyz\",\"to\":\"41793026727\"},{\"to\":\"41793026834\"}],\"flash\":false,\"from\":\"SMSC\",\"intermediateReport\":true,\"language\":{\"languageCode\":\"TR\"},\"notifyContentType\":\"application/json\",\"notifyUrl\":\"https://www.example.com/sms/advanced\",\"text\":\"Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.\",\"transliteration\":\"TURKISH\",\"validityPeriod\":720},{\"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\",\"text\":\"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire.\"}],\"tracking\":{\"track\":\"SMS\",\"type\":\"MY_CAMPAIGN\"}}");
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
{
"bulkId": "BULK-ID-123-xyz",
"trackingProcessKey": "9243E3F4BEDC719D83C2A38A483E6CB3",
"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": "2033912860760522207"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033912860760522208"
}
]
}
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": [
{
"callbackData": "DLR callback data",
"destinations": [
{
"messageId": "MESSAGE-ID-123-xyz",
"to": "41793026727"
},
{
"to": "41793026834"
}
],
"flash": false,
"from": "SMSC",
"intermediateReport": true,
"language": {
"languageCode": "TR"
},
"notifyContentType": "application/json",
"notifyUrl": "https://www.example.com/sms/advanced",
"text": "Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.",
"transliteration": "TURKISH",
"validityPeriod": 720
},
{
"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",
"text": "A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire."
}
],
"tracking": {
"track": "SMS",
"type": "MY_CAMPAIGN"
}
}),
};
$.ajax(settings).done(function (response) {
console.log(response);
});
Response 200-Result Example
{
"bulkId": "BULK-ID-123-xyz",
"trackingProcessKey": "9243E3F4BEDC719D83C2A38A483E6CB3",
"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": "2033912860760522207"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033912860760522208"
}
]
}
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":[{"callbackData":"DLR callback data","destinations":[{"messageId":"MESSAGE-ID-123-xyz","to":"41793026727"},{"to":"41793026834"}],"flash":false,"from":"SMSC","intermediateReport":true,"language":{"languageCode":"TR"},"notifyContentType":"application/json","notifyUrl":"https://www.example.com/sms/advanced","text":"Artık Ulusal Dil Tanımlayıcısı ile Türkçe karakterli smslerinizi rahatlıkla iletebilirsiniz.","transliteration":"TURKISH","validityPeriod":720},{"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","text":"A long time ago, in a galaxy far, far away... It is a period of civil war. Rebel spaceships, striking from a hidden base, have won their first victory against the evil Galactic Empire."}],"tracking":{"track":"SMS","type":"MY_CAMPAIGN"}}`)
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
{
"bulkId": "BULK-ID-123-xyz",
"trackingProcessKey": "9243E3F4BEDC719D83C2A38A483E6CB3",
"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": "2033912860760522207"
},
{
"to": "41793026785",
"status": {
"groupId": 1,
"groupName": "PENDING",
"id": 26,
"name": "PENDING_ACCEPTED",
"description": "Pending Accepted"
},
"messageId": "2033912860760522208"
}
]
}
Response 400-Result Example
{
"requestError": {
"serviceException": {
"messageId": "BAD_REQUEST",
"text": "Bad request"
}
}
}