Authentication

 

Generate an authentication token

 
gethttps://rest.smsportal.com/v1/Authentication
curl --request GET \
  --url https://rest.smsportal.com/v1/Authentication \
  --header 'authorization: Authorization'
var request = require("request");

var options = { method: 'GET',
  url: 'https://rest.smsportal.com/v1/Authentication',
  headers: { authorization: 'Authorization' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://rest.smsportal.com/v1/Authentication")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Authorization'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://rest.smsportal.com/v1/Authentication");
xhr.setRequestHeader("authorization", "Authorization");

xhr.send(data);
import requests

url = "https://rest.smsportal.com/v1/Authentication"

headers = {'authorization': 'Authorization'}

response = requests.request("GET", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Headers

Authorization
string
required

Basic Base64 encoded Authorization Header with your Client Id and Secret

Response

OK

tokenstring

A string representation of the authentication token. Calls to API functions that require a token should use
this value

schemastring

The schema of the authentication token. For example JWT (JSON web token)

expiresInMinutesinteger

The number of minutes after which the authentication token will expire

Bad Request

Unauthorized

Internal Server Error

Service Unavailable

Balance

 

Retrieve the balance for an account

 
gethttps://rest.smsportal.com/v1/Balance
curl --request GET \
  --url https://rest.smsportal.com/v1/Balance \
  --header 'authorization: Authorization'
var request = require("request");

var options = { method: 'GET',
  url: 'https://rest.smsportal.com/v1/Balance',
  headers: { authorization: 'Authorization' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://rest.smsportal.com/v1/Balance")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["authorization"] = 'Authorization'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://rest.smsportal.com/v1/Balance");
xhr.setRequestHeader("authorization", "Authorization");

xhr.send(data);
import requests

url = "https://rest.smsportal.com/v1/Balance"

headers = {'authorization': 'Authorization'}

response = requests.request("GET", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Headers

Authorization
string
required

Bearer Authorization Header with your generated token

Response

OK

balancenumber

The number of credits the account has

Bad Request

Unauthorized

Internal Server Error

Service Unavailable

BulkMessages

 

Send one or more messages

 
posthttps://rest.smsportal.com/v1/BulkMessages
curl --request POST \
  --url https://rest.smsportal.com/v1/BulkMessages \
  --header 'authorization: Authorization'
var request = require("request");

var options = { method: 'POST',
  url: 'https://rest.smsportal.com/v1/BulkMessages',
  headers: { authorization: 'Authorization' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://rest.smsportal.com/v1/BulkMessages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["authorization"] = 'Authorization'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rest.smsportal.com/v1/BulkMessages");
xhr.setRequestHeader("authorization", "Authorization");

xhr.send(data);
import requests

url = "https://rest.smsportal.com/v1/BulkMessages"

headers = {'authorization': 'Authorization'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Body Params

sendOptions
object

The options to be used when sending the SMS messages

 
sendOptions.senderId
string

The sender ID (source address) to use when sending the messages specified. Maximum length is 11 characters.
Please note that a best effort is made to use the value specified but availability is ultimately
determined by the mobile network operator

sendOptions.duplicateCheck
string

The type of duplication check to use (Defaults to 'None')

sendOptions.startDeliveryUtc
date-time

The date and time in UTC when the messages should be sent. Maximum date and time
allowed is 3 months from the current date and time

sendOptions.endDeliveryUtc
date-time

This value should be set in UTC if delivery should be staggered over a period of time. Leave null if all messages
should be sent as soon as possible. Value, if set, must be greater than StartDeliveryUtc

sendOptions.replyRuleSetName
string

The name of the reply rule set that should be used for the send. Replies that are received as a result of
the send are then subject to rules configured in the reply rule set governing auto forwards and auto
responses

sendOptions.campaignName
string

A user defined value for the name of the campaign associated with this send. Only used by the system for
reporting purposes. Maximum value is 100 characters

sendOptions.costCentre
string

A user defined value for the name of the cost center associated with this send. Only used by the system for
reporting purposes. Maximum value is 100 characters

sendOptions.checkOptOuts
boolean

True if SMS messages should not be sent to mobile subscribers that have opted-out as a result of a previous
send; otherwise false

sendOptions.validityPeriod
int32

The amount of time in hours an SMS should remain valid. The network will continue to try to deliver the SMS over the validity period.

messages
array of objects
required

The SMS message(s) that should be send. Must contain at least one message and at most 100 messages

content
destination
customerId

Headers

Authorization
string
required

Bearer Authorization Header with your generated token

Response

OK

costnumber

The total cost of the send excluding any VAT, GST or tax

remainingBalancenumber

The remaining balance after the Cost has been deducted for the send

eventIdinteger

The system generated ID for this send or batch of messages

samplestring

A sample message that was generated for the send. Purely informational

costBreakdownarray

The break down of the costs for the send grouped by mobile network and feature

messagesinteger

The total number of messages that were successfully enqueued for delivery. Long messages may require
multiple SMS messages or parts to send a message and this is reflected in the Parts value

partsinteger

The total number of SMS messages that were successfully enqueued for delivery.

errorReportobject

A report outlining the faults in the send

errorReport.noNetworkinteger
errorReport.duplicatesinteger
errorReport.optedOutsinteger
errorReport.faultsarray

Bad Request

Unauthorized

Internal Server Error

Service Unavailable

GroupMessages

 

Sends a message to contacts in the group

 
posthttps://rest.smsportal.com/v1/GroupMessages
curl --request POST \
  --url https://rest.smsportal.com/v1/GroupMessages \
  --header 'authorization: Authorization'
var request = require("request");

var options = { method: 'POST',
  url: 'https://rest.smsportal.com/v1/GroupMessages',
  headers: { authorization: 'Authorization' } };

request(options, function (error, response, body) {
  if (error) throw new Error(error);

  console.log(body);
});
require 'uri'
require 'net/http'

url = URI("https://rest.smsportal.com/v1/GroupMessages")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["authorization"] = 'Authorization'

response = http.request(request)
puts response.read_body
var data = JSON.stringify(false);

var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function () {
  if (this.readyState === this.DONE) {
    console.log(this.responseText);
  }
});

xhr.open("POST", "https://rest.smsportal.com/v1/GroupMessages");
xhr.setRequestHeader("authorization", "Authorization");

xhr.send(data);
import requests

url = "https://rest.smsportal.com/v1/GroupMessages"

headers = {'authorization': 'Authorization'}

response = requests.request("POST", url, headers=headers)

print(response.text)
A binary file was returned

You couldn't be authenticated

Try the API to see results

Body Params

sendOptions
object

The options to use when sending SMS messages

 
sendOptions.senderId
string

The sender ID (source address) to use when sending the messages specified. Maximum length is 11 characters.
Please note that a best effort is made to use the value specified but availability is ultimately
determined by the mobile network operator

sendOptions.duplicateCheck
string

The type of duplication check to use (Defaults to 'None')

sendOptions.startDeliveryUtc
date-time

The date and time in UTC when the messages should be sent. Maximum date and time
allowed is 3 months from the current date and time

sendOptions.endDeliveryUtc
date-time

This value should be set in UTC if delivery should be staggered over a period of time. Leave null if all messages
should be sent as soon as possible. Value, if set, must be greater than StartDeliveryUtc

sendOptions.replyRuleSetName
string

The name of the reply rule set that should be used for the send. Replies that are received as a result of
the send are then subject to rules configured in the reply rule set governing auto forwards and auto
responses

sendOptions.campaignName
string

A user defined value for the name of the campaign associated with this send. Only used by the system for
reporting purposes. Maximum value is 100 characters

sendOptions.costCentre
string

A user defined value for the name of the cost center associated with this send. Only used by the system for
reporting purposes. Maximum value is 100 characters

sendOptions.checkOptOuts
boolean

True if SMS messages should not be sent to mobile subscribers that have opted-out as a result of a previous
send; otherwise false

sendOptions.validityPeriod
int32

The amount of time in hours an SMS should remain valid. The network will continue to try to deliver the SMS over the validity period.

message
string
required

The content of the SMS message that should be sent

groups
array of strings
required

The names of the groups that contacts should belong to. These contacts will be the recipients of
the SMS message. Should contain at least one group name

Headers

Authorization
string
required

Bearer Authorization Header with your generated token

Response

OK

costnumber

The total cost of the send excluding any VAT, GST or tax

remainingBalancenumber

The remaining balance after the Cost has been deducted for the send

eventIdinteger

The system generated ID for this send or batch of messages

samplestring

A sample message that was generated for the send. Purely informational

costBreakdownarray

The break down of the costs for the send grouped by mobile network and feature

messagesinteger

The total number of messages that were successfully enqueued for delivery. Long messages may require
multiple SMS messages or parts to send a message and this is reflected in the Parts value

partsinteger

The total number of SMS messages that were successfully enqueued for delivery.

errorReportobject

A report outlining the faults in the send

errorReport.noNetworkinteger
errorReport.duplicatesinteger
errorReport.optedOutsinteger
errorReport.faultsarray

Bad Request

Unauthorized

Internal Server Error

Service Unavailable