Last updated: Mar 6th 2024

API Introduction

RESTful API to send SMS

Register your account

If you don't have an account, head to https://bestsms.au/signup and register.


Create an API user

To access the API, you'll need a User with API access:

  1. Log into the BestSMS Dashboard
  2. Select Users from the menu, then click Create to create a new user, or select an existing user from the list.
  3. Under the API Options tab, if API access isn't set up, toggle Enable API, then create an "API Key" (you can click the Generate button to auto-create one), then click Update to save your changes.
  4. Under the API Options tab, next to "Auth Token" click Copy button. This will copy your Auth Token to your clipboard.

The API v2.03 uses JWT token Authentication. Contact your BestSMS Representative for OAuth2 authentication.

You can use one Auth Token for multiple use-cases, using the SubAccount and Department values to track reporting and billing.


Understanding the API basics

The API URL:
https://api.bestsms.com.au/api/[Version]/[Action]/[MessageType]


  • [Version] is the API Version ('v2.03')
  • [Action] defines the module ('send' a message or 'get' a status)
  • [MessageType] is the type of message ('sms')


The API HTTP Headers:

The HTTP Headers define the API call's formatting -


> Headers for JSON formatted calls:

Content-Type="application/json; encoding='utf-8'"
Accept="application/json; encoding='utf-8'"
Authorization="Basic [Auth Token]"

** The 'Accept' header is optional but encouraged


> Headers for XML formatted calls:

Content-Type="application/xml; encoding='utf-8'"
Accept="application/xml; encoding='utf-8'"
Authorization="Basic [Auth Token]"

** Both 'Content-Type' and 'Accept' headers are mandatory



An API Send Example

An example for sending an outbound SMS using Raw JSON -

URL:
- https://api.bestsms.com.au/api/v2.03/send/sms

Headers:
- Content-Type="application/json; encoding='utf-8'"
- Accept="application/json; encoding='utf-8'"
- Authorization="Basic eyJ0eXA....436k0-E4"

Data:
{
"MessageData" : {
  "Message": "Hello, this is a test.",
  "Destinations" : [ { "Recipient": "+61421000001" } ]
  }
}


Possible HTTP status values are:

  • 200 OK - Message Accepted
  • 400 BAD REQUEST - Invalid Variables
  • 401 Unauthorized - Invalid Auth Token
  • 500 Internal Server Error - API Server Fault

An example JSON response value:

  • {
      "Result": "%STATUS%",
      "MessageID": "%MESSAGEID%"
    }
  • Status - 'Success' or 'Failed' refers to your API POST result (explains whether your POST was accepted by our server). This is not your message's delivery result - to track message delivery, see API - Status Reporting.
  • MessageID - A message tracking identifier (maximum 40 characters, alphanumeric). If you do not supply this field in your submitted MessageData, the API will return one for you in the response body (UUID v4 of 36 characters).
  • Note - The API will verify that required fields are supplied, however it will not validate data.

API - Send Messages

Find instructions for each Message Type:

HTTP Method: POST

Sending SMS - Send SMS/TXT via REST API

 
 
API URL:        https://api.bestsms.com.au/api/v2.03/send/sms
HTTP Method:    POST

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required MessageData parameters

Parameter Example Value Description
Message Hello, this is a test message from Department01. Thank you. Plain or UTF-8 formatted SMS message
Destinations > Recipient +61421000002 Receiving mobile number. See the Destinations parameter below for more information.

Optional MessageData parameters

Parameter Example Value Description
MessageID ID123456 A Message Identifier helps you keep track of each message (maximum 40 characters, alphanumeric). Use a unique MessageID for each request. If you leave this field blank, the API will generate a 36-character UUID (v4) for you and include it in the response body.
Reference Test1 Human readable message description (free format field, maximum 80 characters).
WebhookCallbackURL https://www.example.com/webhook Overrides your Sender's default Webhook URL. Requires a default webhook to be configured. A full path including https:// is required.
WebhookCallbackFormat JSON Overrides your Sender's default Webhook format ('JSON' or 'XML')
SendTime 2021-12-31T23:00 Delay sending until the specified date/time, a single point of time in a combined date and time representation ({date}T{time}; for example, 2017-08-29T04:00 in your local timezone, specified by your Sender setting or overridden using the TimeZone command).
TimeZone AUS Eastern User's local timezone
SubAccount SubAccount01 Used for reporting, billing and Web Dashboard segmentation.
Department Department01 Used for reporting, billing and Web Dashboard segmentation.
ChargeCode BillingGroup01 Bespoke app cost allocation code (for invoice segmentation)
FromNumber 61421000001 Setting SMS origination number.
SMSEmailReply [email protected] For email (SMTP) reply receipt notifications
CharacterConversion true Convert multi-byte characters into normalised GSM character format. ie. © to (C)
Destinations > Recipient +61421000001 Recipient of the SMS.

We recommend implementing a prefix check to limit potential Toll Fraud.
> Attention John Doe Recipient's name
> First Name John Recipient's first name
> Last Name Doe Recipient's last name
> Company Example Corp Recipient's company
> Custom1 Customisable tracking and personalisation field
> Custom2 Customisable tracking and personalisation field
Files > Name File Name.pdf Files referenced in [[File1]] commands (for MessageLink)
> Data %%Base-64%% Base-64 encoded value of the attached file

Sending messages in test mode

Under MessageData you can specify an additional Mode=Test parameter.

Mode=Test means any messages will be handled by the API, instantly called a SUCCESS and the success report will be delivered to you. This is a useful way to end-to-end test without sending a live message.


...
  "MessageData" :
  {
      ...
      "Mode": "Test"
  }
...
                                            
HTTP Method: PATCH

API - Edit Messages - Edit a submitted message

Once a message has been sent, you can retry a failed message, reschedule a delayed message and abort a delayed message.


Retry Sending - Resubmit a failed message

If your message is 'Failed' (sending completed and was unsuccessful), you can use this API module to retry sending.

The Retry is applied to a specific MessageID. If you use common MessageID values across multiple messages, it will apply to the most recent message and only if the Status was Failed.


 
API URL:        https://api.bestsms.com.au/api/v2.03/set/resubmit/[MessageID]
HTTP Method:    PATCH

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required parameters

Parameter Example Value Description
MessageID ID123456 MessageID the Action should apply to
SendTime (Optional) 2021-12-31T23:00 Delay sending until the specified date/time, a single point of time in a combined date and time representation ({date}T{time}; for example, 2024-08-29T04:00 in your local timezone, specified by your Sender setting or overridden using the TimeZone command).

SUCCESS response parameters

Parameter Example Value Description
Result Success Result of your API call (not the result of the message)
MessageID ID123456 MessageID the Action was applied to
Status Transmit State of the message prior to performing the Action ('Transmit', 'Pending', 'Delayed', 'CreditHold', 'Deleted')
JobNum ABCD1234 Eight digit alphanumeric tracking number (our internal Job Number)
Action Resubmit The Action performed

FAILED response parameters

Parameter Example Value Description
Result Failed Result of your API call (not the result of the message)
MessageID ID123456 MessageID provided in your request
Message Message not found Reason for the API call failure



HTTP Method: PATCH

Reschedule Sending - Adjust the Delayed Sending Date/Time

If you have an existing Delayed message (scheduled for sending at a future date/time), you can use this API module to adjust the sending date/time.

The adjustment is applied to a specific MessageID. If you use common MessageID values across multiple messages, it will apply to the most recent message.


 
API URL:        https://api.bestsms.com.au/api/v2.03/set/reschedule/[MessageID]
HTTP Method:    PATCH

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required parameters

Parameter Example Value Description
MessageID ID123456 MessageID the Action should apply to
SendTime 2021-12-31T23:00 Reschedule sending for the specified date/time, a single point of time in a combined date and time representation ({date}T{time}; for example, 2017-08-29T04:00 in your local timezone, specified by your Sender setting or overridden using the TimeZone command).

SUCCESS response parameters

Parameter Example Value Description
Result Success Result of your API call (not the result of the message)
MessageID ID123456 MessageID the Action was applied to
Status Transmit State of the message prior to performing the Action ('Transmit', 'Pending', 'Delayed', 'CreditHold', 'Deleted')
JobNum ABCD1234 Eight digit alphanumeric tracking number (our internal Job Number)
Action Reschedule The Action performed

FAILED response parameters

Parameter Example Value Description
Result Failed Result of your API call (not the result of the message)
MessageID ID123456 MessageID provided in your request
Message Message not found Reason for the API call failure



HTTP Method: PATCH

Abort Sending - Cancel/Delete a Message from the Queue

If you have an existing Delayed message (scheduled for sending at a future date/time) you can use this API module to Cancel sending of the message.

The cancellation is applied to a specific MessageID. If you use common MessageID values across multiple messages, it will apply to the most recent message.


 
API URL:        https://api.bestsms.com.au/api/v2.03/set/abort/[MessageID]
HTTP Method:    PATCH

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required parameters

Parameter Example Value Description
MessageID ID123456 MessageID the Action should apply to

SUCCESS response parameters

Parameter Example Value Description
Result Success Result of your API call (not the result of the message)
MessageID ID123456 MessageID the Action was applied to
Status Delayed State of the message prior to performing the Action ('Transmit', 'Pending', 'Delayed', 'CreditHold', 'Deleted')
JobNum ABCD1234 Eight digit alphanumeric tracking number (our internal Job Number)
Action Abort The Action performed

FAILED response parameters

Parameter Example Value Description
Result Failed Result of your API call (not the result of the message)
MessageID ID123456 MessageID provided in your request
Message Message not found Reason for the API call failure

API - Status Reporting - Reporting and event tracking

Delivery Reports advise whether delivery was successful. If not, it will describe why.

Each delivery report type is optional and multiple delivery report types can be used.



Web Dashboard - Tracking message statuses via the online dashboard

You will be supplied with a Web Dashboard login at registration. The Dashboard can be used to set up new sender/token pairs, as well as track sent and replied messages. You can drill into specific messages to view individual events, such as delivery attempts, retries, replies, results, clicks, etc.



SMTP Email - Receive message statuses via email

Delivery reports are emailed as an HTML email for viewing by an end-user. Your sales representative can enable this for you.

Whitelabelling of SMTP Email reports is available.



HTTP Method: POST

Webhook - Message statuses delivered via a webhook

To receive Delivery Reports via Webhook, please advise the URL to submit to.

Webhooks are delivered as an HTTP POST in either XML or JSON format (your preference; defined by the WebhookCallbackFormat in your outbound message).

Webhook failures are retried every five minutes for a maximum of 24 hours.


 
 
API URL:        https://www.example.com/webhook
HTTP Method:    POST
HTTP Headers:   Content-Type="application/json"

{
  "Sender": "[email protected]",
  "APIKey": "ta8wr7ymd",
  "Type": "SMS",
  "Destination": "+61421000001",
  "MessageID": "js82hn8n",
  "SubAccount": "SubAccount01",
  "Department": "Department01",
  "JobNumber": "10C7B9A0",
  "SentTime": "16/10/2019 13:43 p.m.",
  "Status": "SUCCESS",
  "Result": "delivered",
  "Price": "0.10",
  "Detail": "SMSParts:1",
  "URL": "https://www.example.com/webhook",
  "RESPONSEMODE": "JSON"
}          

Copy code

API URL:        https://www.example.com/webhook
HTTP Method:    POST
HTTP Headers:   Content-Type="text/xml"

<?xml version='1.0' encoding='UTF-8'?>
<root>
  <Sender>[email protected]</Sender>
  <APIKey>ta8wr7ymd</APIKey>
  <Type>SMS</Type>
  <Destination>+61421000001</Destination>
  <MessageID>js82hn8n</MessageID>
  <SubAccount>SubAccount01</SubAccount>
  <Department>Department01</Department>
  <JobNumber>10C7B9A0</JobNumber>
  <SentTime>2019-10-16 14:52 p.m.</SentTime>
  <Status>SUCCESS</Status>
  <Result>delivered</Result>
  <Price>0.10</Price>
  <Detail>SMSParts:1</Detail>
  <URL>https://www.example.com/webhook</URL>
  <RESPONSEMODE>XML</RESPONSEMODE>
</root>          

Copy code

Parameters:

Parameter Example Value Description
Destination +61421000001 Destination that the webhook is for (alphanumeric field, where telephone/mobile numbers are supplied in E.164 internationalised format)
MessageID js82hn8n MessageID parameter supplied when sending your original API call
SubAccount SubAccount01 Used for reporting, billing and Web Dashboard segmentation
Department Department01 Used for reporting, billing and Web Dashboard segmentation
JobNumber 10C7B9A0 Eight digit alphanumeric tracking number (our internal Job Number)
SentTime 16/10/2019 13:43 p.m. Time message was completed (Sender's local time time in 'dd/MM/yyyy HH:mm tt' format)
Status SUCCESS For submission results, values are SUCCESS, FAILED, PENDING
For reply reports, this will be RECEIVED
For additional analytics, this will be UPDATED
Result Sent OK Final delivery result and/or the cause for a message delivery failure. Email result codes are defined by the receiving email server
For reply reports, this will be RECEIVED
For additional analytics, this will be the event description
Price 0.20 Your cost for this transaction, charged by us to you
Detail SMSParts:2 Additional billing detail: "SMSParts", "FaxPages", "VoiceMinutes", "Size", "Prompts"
URL https://www.example.com/webhook The URL this webhook is sent to
RESPONSEMODE JSON This webhook's format


HTTP Method: GET

GET Status Poll - Track message statuses using a GET poll

API users are able to poll for the status of a message via the GET Status API.

The GET Poll should be configured to timeout after 48 hours with no result.


 
 
API URL:        https://api.bestsms.com.au/api/v2.03/get/status/[MessageID]
HTTP Method:    GET

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required parameters

Parameter Example Value Description
MessageID ID123456 Your provided Message ID or BestSMS generated Message ID

Success Response parameters

Parameter Example Value Description
Result Success Result of your API call (not the result of the message)
MessageID AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD Your provided Message ID or BestSMS generated Message ID
Status Completed Current state of the message ('Unknown', 'Pending', 'Delayed', 'Completed', 'CreditHold')
JobNum 10AB20CE Eight digit alphanumeric tracking number (our internal Job Number)
Account 102030 Your BestSMS Account
SubAccount Your supplied BestSMS SubAccount
Department Your supplied BestSMS Department
Count 5 Total Destinations specified in the message
Complete 5 Total Destinations where message transmission has completed
Success 4 Total Destinations where message result is Success
Failed 1 Total Destinations where message result is Failed

Failed Response parameters

Parameter Example Value Description
Result Failed Result of your API call (not the result of the message)
MessageID AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD Your provided Message ID or BestSMS generated Message ID
Message Missing Sender Reason for the API call failure

API - Receive Messages - Track messages received

Currently, tracking SMS Received is supported.

Tracking of faxes and voicemail received is scheduled for a future release. Let your account manager know if this interests you.



Web Dashboard - Tracking messages received via the online dashboard

You will be supplied with a Web Dashboard login at registration. The Dashboard can be used to set up new sender/token pairs, as well as track sent and replied messages. You can drill into specific messages to view individual events, such as delivery attempts, retries, replies, results, clicks, etc.



SMTP Email - Track messages received via email

Reply message reports are emailed as an HTML email for viewing by an end-user.
Whitelabelling of SMTP Email reports is available.

When submitting SMS messages, specify the SMSEmailReply parameter.



Webhook - Messages received data delivered via a webhook

If you are set up to receive Status webhooks, you will also be receiving SMS Received webhooks.

To receive SMS replies via Webhook, please advise the URL to submit to.

Webhooks are delivered as an HTTP POST in either XML or JSON format (your preference; defined by the WebhookCallbackFormat in your outbound message).

Webhook failures are retried every five minutes for a maximum of 24 hours.

The mobile has 7 days to reply to a message. Any replies received after the 7 day window will be treated as a new message.


 
 
API URL:        https://www.example.com/webhook
HTTP Method:    POST
HTTP Headers:   Content-Type="application/json"

{
  "Sender": "[email protected]",
  "APIKey": "ta8wr7ymd",
  "Type": "SMSReply",
  "Destination": "+61421000001",
  "MessageID": "js82hn8n",
  "SubAccount": "SubAccount01",
  "Department": "Department01",
  "JobNumber": "10C7B9A0",
  "SentTime": "2019-10-16 13:43:00",
  "Status": "RECEIVED",
  "Result": "RECEIVED",
  "Message": "This is a reply.",
  "Price": "",
  "Detail": "",
  "URL": "https://www.example.com/webhook",
  "RESPONSEMODE": "JSON"
}          

Copy code

API URL:        https://www.example.com/webhook
HTTP Method:    POST
HTTP Headers:   Content-Type="text/xml"

<?xml version="1.0" encoding="UTF-8" ?>
<root>
  <Sender>[email protected]</Sender>
  <APIKey>ta8wr7ymd</APIKey>
  <Type>SMSReply</Type>
  <Destination>+61421000001</Destination>
  <MessageID>js82hn8n</MessageID>
  <SubAccount>SubAccount01</SubAccount>
  <Department>Department01</Department>
  <JobNumber>10C7B9A0</JobNumber>
  <SentTime>2019-10-16 13:43</SentTime>
  <Status>RECEIVED</Status>
  <Result>RECEIVED</Result>
  <Message>This is a reply.</Message>
  <Price></Price>
  <Detail></Detail>
  <URL>https://www.example.com/webhook</URL>
  <RESPONSEMODE>XML</RESPONSEMODE>
</root>          

Copy code

Parameters:

Parameter Example Value Description
Sender [email protected] Webhook sender authentication (can configure a unique Sender if required)
APIKey ta8wr7ymd Webhook token authentication (can configure a unique APIKey if required)
Type SMSReply Type of Message ('Email', 'SMS', 'Fax', 'Voice', 'TextToSpeech', 'SMSInbound' or 'SMSReply')
Destination +61421000001 Mobile number that sent the SMS (alphanumeric field, where telephone/mobile numbers are supplied in E.164 internationalised format)
MessageID js82hn8n MessageID parameter supplied when sending your original API call
SubAccount SubAccount01 Used for reporting, billing and Web Dashboard segmentation
Department Department01 Used for reporting, billing and Web Dashboard segmentation
JobNumber 10C7B9A0 Eight digit alphanumeric tracking number (our internal Job Number)
SentTime 16/10/2019 13:43 p.m. Time reply message was received
Status RECEIVED For submission results, values are SUCCESS, FAILED, PENDING
For reply reports, this will be RECEIVED
For additional analytics, this will be UPDATED
Result RECEIVED Final delivery result and/or the cause for a message delivery failure
For reply reports, this will be RECEIVED
For additional analytics, this will be the event description
Message This is a reply. The received SMS message (if 'Type=SMSInbound' or 'Type=SMSReply')
Price 0.20 Your cost for the outbound message sent, charged by us to you (no cost for the reply received)
Detail SMSParts:2 Additional billing detail: "SMSParts", "FaxPages", "VoiceMinutes", "Size", "Prompts" on the outbound message sent (not the SMS Received)
URL https://www.example.com/webhook The URL this webhook is sent to
RESPONSEMODE JSON This webhook's format


HTTP Method: GET

GET SMS Received Poll - View all Inbound SMS using a GET poll

API users are able to poll for all received SMS messages in a given time-frame.


 
 
API URL:        https://api.bestsms.com.au/api/v2.03/get/sms/received?timePeriod=[minutes]
URL Parameters: timePeriod=[minuts] //optional
  dateFrom=[From Date] //optional
  dateTo=[To Date] //optional
  page=[Page Number] //optional
  recordsPerPage=[No. of Records Per Page] //optional
HTTP Method:    GET

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

URL parameters

Parameter Example Value Description
TimePeriod 1440 Return results from the last x minutes
dateFrom 2024-08-01T00:00:00 Return results from the specified date (optional)
dateTo 2024-08-01T23:59:59 Return results to the specified date (optional)
recordsPerPage 20 Return x number of records per request (optional)
page 1 Current location of the result set (optional)

SUCCESS Response parameters

Parameter Example Value Description
Result Success Result of your API call (not the result of the message)
Date 2019-12-01 14:02:03 Date/Time SMS was received (yyyy-mm-dd HH:mm:ss)
From +61421000001 Sender of the SMS in E.164 internationalised format
MessageText This is a reply back from the mobile phone. The SMS message received

FAILED Response parameters

Parameter Example Value Description
Result Failed Result of your API call (not the result of the message)
Message Missing Sender Reason for the API call failure


HTTP Method: PATCH

GET SMS Reply Poll - Track individual reply SMS messages using a GET poll

API users are able to poll for replies to a specific SMS message, tracked using the MessageID on the outbound message.

The GET Poll should be configured to timeout after 48 hours with no result.


 
 
API URL:        https://api.bestsms.com.au/api/v2.03/get/sms/reply/[MessageID]
HTTP Method:    GET

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required URL parameters

Parameter Example Value Description
MessageID ID123456 Your provided Message ID or BestSMS generated Message ID

Success Response parameters

Parameter Example Value Description
Result Success Result of your API call (not the result of the message)
Status Received Static value
JobNum 10AB20CE Eight digit alphanumeric tracking number (our internal Job Number)
Account 102030 Your BestSMS Account
SubAccount Your supplied BestSMS SubAccount
Department Your supplied BestSMS Department
MessageSent Date 2019-12-01 13:45:54 Time SMS was sent (yyyy-mm-dd HH:mm:ss)
Destination +61421000001 Recipient of the SMS in E.164 internationalised format
MessageText This is an outbound message sent via API. Plain or UTF-8 formatted SMS message sent
MessageReceived Date 2019-12-01 14:02:03 Time SMS was received (yyyy-mm-dd HH:mm:ss)
From +61421000001 Sender of the SMS in E.164 internationalised format
MessageText This is a reply back from the mobile phone. Plain or UTF-8 formatted SMS message received

Failed Response parameters

Parameter Example Value Description
Result Failed Result of your API call (not the result of the message)
MessageID AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD Your provided Message ID or BestSMS generated Message ID
Message Missing Sender Reason for the API call failure

HTTP Method: GET

List Contacts- Get Contact List via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/contact/list
URL Parameters: page=[Page Number] //optional
  recordsPerPage=[No. of Records Per Page] //optional
HTTP Method:    GET

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Optional URL Parameters

Parameter Example Value Description
recordsPerPage 50 Specifies the number of records per page to be returned. If not provided, the default number (100) of records per page will be used.
page 1 Specifies the page number of the contact list to retrieve. If not provided, the default (1) behaviour will be followed.
HTTP Method: GET

Get Contact Detail- Get Contact Detail via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/contact/[ContactID]
HTTP Method:    GET

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required URL parameters

Parameter Example Value Description
ContactID 17f2b37e-4706-41c8-8dcb-de90e24c2447 Specifies the unique identifier of the contact to retrieve.
HTTP Method: POST

Create Contact - Create Contact via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/contact
HTTP Method:    POST

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Optional Request Body Properties

Property Example Value Description
ViewBy Account Specifies the visibility of the contact. Values can be "Account", "SubAccount", "Department" or "No" visibility option.
EditBy Account Specifies the permission level required to edit the contact. Values can be "Account", "SubAccount", "Department" or "No" permission option.
Attention Person Attention Indicates the attention or focus associated with the contact.
Title Ms Represents the title or honorific of the contact (e.g., Mr, Mrs, Ms).
Company BestSMS Specifies the company or organization associated with the contact.
RecipDepartment Sales Dept. Indicates the department or division within the company associated with the contact.
FirstName Person first name Represents the first name of the contact.
LastName Person last name Represents the last name of the contact.
Position Sales Represent Specifies the job position or role of the contact.
StreetAddress 123 ABC st. Represents the street address or location of the contact.
Suburb My Suburb Specifies the suburb or district associated with the contact's address.
City Sydney Indicates the city or locality associated with the contact's address.
State NZ Represents the state or province associated with the contact's address.
Country Australia Specifies the country associated with the contact's address.
Postcode 1234 Represents the postal code or ZIP code associated with the contact's address.
MainPhone 092223333 Specifies the main phone number of the contact. This property typically used for Voice & Text-To-Speech messages.
AltPhone1 093334444 Represents an alternate phone number for the contact. This property typically used for Voice & Text-To-Speech messages.
AltPhone2 094445555 Represents a second alternate phone number for the contact. This property typically used for Voice & Text-To-Speech messages.
DirectPhone 094445555 Indicates the direct phone number of the contact.
MobilePhone 0211144489 Represents the mobile phone number of the contact. This property typically used for SMS messages.
FaxNumber 093334444 Specifies the fax number associated with the contact.
EmailAddress [email protected] Represents the email address of the contact.
WebAddress https://bestsms.au Specifies the website address or URL associated with the contact.
Custom1...Custom4 Custom Value Represents custom fields or additional information associated with the contact.
HTTP Method: PATCH

Update Contact - Update Contact via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/contact/[ContactID]
HTTP Method:    PATCH

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required URL parameters

Parameter Example Value Description
ContactID 17f2b37e-4706-41c8-8dcb-de90e24c2447 Specifies the unique identifier of the contact to retrieve.

Properties Request Body Properties

Property Example Value Description
ViewBy Account Specifies the visibility of the contact. Values can be "Account", "SubAccount", "Department" or "No" visibility option.
EditBy Account Specifies the permission level required to edit the contact. Values can be "Account", "SubAccount", "Department" or "No" permission option.
Attention Person Attention Indicates the attention or focus associated with the contact.
Title Ms Represents the title or honorific of the contact (e.g., Mr, Mrs, Ms).
Company BestSMS Specifies the company or organization associated with the contact.
RecipDepartment Sales Dept. Indicates the department or division within the company associated with the contact.
FirstName Person first name Represents the first name of the contact.
LastName Person last name Represents the last name of the contact.
Position Sales Represent Specifies the job position or role of the contact.
StreetAddress 123 ABC st. Represents the street address or location of the contact.
Suburb My Suburb Specifies the suburb or district associated with the contact's address.
City Sydney Indicates the city or locality associated with the contact's address.
State NZ Represents the state or province associated with the contact's address.
Country Australia Specifies the country associated with the contact's address.
Postcode 1234 Represents the postal code or ZIP code associated with the contact's address.
MainPhone 092223333 Specifies the main phone number of the contact. This property typically used for Voice & Text-To-Speech messages.
AltPhone1 093334444 Represents an alternate phone number for the contact. This property typically used for Voice & Text-To-Speech messages.
AltPhone2 094445555 Represents a second alternate phone number for the contact. This property typically used for Voice & Text-To-Speech messages.
DirectPhone 094445555 Indicates the direct phone number of the contact.
MobilePhone 0211144489 Represents the mobile phone number of the contact. This property typically used for SMS messages.
FaxNumber 093334444 Specifies the fax number associated with the contact.
EmailAddress [email protected] Represents the email address of the contact.
WebAddress https://bestsms.au Specifies the website address or URL associated with the contact.
Custom1...Custom4 Custom Value Represents custom fields or additional information associated with the contact.
HTTP Method: DELETE

Delete Contact - Delete Contact via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/contact/[ContactID]
HTTP Method:    DELETE

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required URL parameters

Parameter Example Value Description
ContactID 17f2b37e-4706-41c8-8dcb-de90e24c2447 Specifies the unique identifier of the contact to retrieve.
HTTP Method: GET

List Contact Groups- Get Contact Group List via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/contact/[ContactID]/group/list
URL Parameters: page=[Page Number] //optional
  recordsPerPage=[No. of Records Per Page] //optional
HTTP Method:    GET

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required URL parameters

Parameter Example Value Description
ContactID 17f2b37e-4706-41c8-8dcb-de90e24c2447 Specifies the unique identifier of the contact to retrieve.

Optional URL Parameters

Parameter Example Value Description
recordsPerPage 50 Specifies the number of records per page to be returned. If not provided, the default number (100) of records per page will be used.
page 1 Specifies the page number of the group list to retrieve. If not provided, the default (1) behaviour will be followed.
HTTP Method: GET

Get Contact Group Detail- Get Contact Group Detail via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/contact/[ContactID]/group/[Group Code]
HTTP Method:    GET

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required URL parameters

Parameter Example Value Description
ContactID 17f2b37e-4706-41c8-8dcb-de90e24c2447 Specifies the unique identifier of the contact to retrieve.
Group Code Test_Group Specifies the unique identifier of the group to retrieve.
HTTP Method: POST

Create Contact Group - Create Contact Group via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/contact/[ContactID]/group
HTTP Method:    POST

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required URL parameters

Parameter Example Value Description
ContactID 17f2b37e-4706-41c8-8dcb-de90e24c2447 Specifies the unique identifier of the contact to create relationship.

Required Request body properties

Property Example Value Description
GroupCode Test-Group Specifies the code or identifier of the group to which the contact relationship should be added.
HTTP Method: DELETE

Delete Contact Group - Delete Contact Group via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/contact/[ContactID]/group/[GroupCode]
HTTP Method:    DELETE

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required URL parameters

Parameter Example Value Description
ContactID 17f2b37e-4706-41c8-8dcb-de90e24c2447 Specifies the unique identifier of the contact to delete.
GroupCode Test-Group Specifies the code or identifier of the group to be deleted.
HTTP Method: GET

List Groups- Get Group List via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/group/list
URL Parameters: page=[Page Number] //optional
  recordsPerPage=[No. of Records Per Page] //optional
HTTP Method:    GET

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Optional URL Parameters

Parameter Example Value Description
recordsPerPage 50 Specifies the number of records per page to be returned. If not provided, the default number (100) of records per page will be used.
page 1 Specifies the page number of the group list to retrieve. If not provided, the default (1) behaviour will be followed.
HTTP Method: GET

Get Group Detail- Get Group Detail via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/group/[GroupCode]
HTTP Method:    GET

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required URL parameters

Parameter Example Value Description
GroupCode Test-Group Specifies the code or identifier of the group to retrieve.
HTTP Method: POST

Create Group - Create Group via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/group
HTTP Method:    POST

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required Request Body Properties

Property Example Value Description
GroupName Test Group Specifies the name of the group. If GroupCode is not specified, BestSMS API will take group name and replace white space into underscore.

Optional Request Body Properties

Property Example Value Description
GroupCode Test-Group Specifies the code or identifier for the group. Leave empty if you want the system to generate the code from the group name.
SubAccount Test SubAccount Specifies the subaccount associated with the group.
Department Test Department Specifies the department or division associated with the group.
ViewEditBy Account Specifies the visibility and edit permissions for the group. Values can be "Account", "SubAccount", "Department" or "No" permission option.
HTTP Method: PATCH

Update Group - Update Group via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/group/[GroupCode]
HTTP Method:    PATCH

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required URL parameters

Parameter Example Value Description
GroupCode Test-Group Specifies the code or identifier of the group to be updated.

Optional Request Body Properties

Property Example Value Description
GroupName Test Group Specifies the name of the group. Unlike 'Create' API, updating GroupName will NOT change the GroupCode.
SubAccount Test SubAccount Specifies the subaccount associated with the group.
Department Test Department Specifies the department or division associated with the group.
ViewEditBy Account Specifies the visibility and edit permissions for the group. Values can be "Account", "SubAccount", "Department" or "No" permission option.
HTTP Method: DELETE

Delete Group - Delete Group via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/group/[GroupCode]
HTTP Method:    DELETE

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required URL parameters

Parameter Example Value Description
GroupCode Test-Group Specifies the code or identifier of the group to be deleted.
HTTP Method: GET

List Group Contacts- Get Group Contact List via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/group/[GroupCode]/contact/list
URL Parameters: page=[Page Number] //optional
  recordsPerPage=[No. of Records Per Page] //optional
HTTP Method:    GET

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required URL parameters

Parameter Example Value Description
GroupCode Test-Group Specifies the code or identifier of the group to be deleted.

Optional URL Parameters

Parameter Example Value Description
recordsPerPage 50 Specifies the number of records per page to be returned. If not provided, the default number (100) of records per page will be used.
page 1 Specifies the page number of the contact list to retrieve. If not provided, the default (1) behaviour will be followed.
HTTP Method: GET

Get Group Contact Detail- Get Group Contact Detail via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/group/[Group Code]/contact/[ContactID]
HTTP Method:    GET

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required URL parameters

Parameter Example Value Description
Group Code Test_Group Specifies the unique identifier of the group to retrieve.
ContactID 17f2b37e-4706-41c8-8dcb-de90e24c2447 Specifies the unique identifier of the contact to retrieve.
HTTP Method: POST

Create Group Contact - Create Group Contact via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/group/[GroupCode]/contact
HTTP Method:    POST

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required URL parameters

Parameter Example Value Description
GroupCode Test-Group Specifies the code or identifier of the group to which the contact relationship should be added.

Required Request body properties

Property Example Value Description
ContactID 17f2b37e-4706-41c8-8dcb-de90e24c2447 Specifies the unique identifier of the contact to create relationship.
HTTP Method: DELETE

Delete Group Contact - Delete Group Contact via REST API

 
API URL:        https://api.bestsms.com.au/api/v2.03/addressbook/group/[GroupCode]/contact/[ContactID]
HTTP Method:    DELETE

    
Sample SUCCESS Response [HTTP Response Status: 200 OK]:
Sample FAILURE Response [HTTP Response Status: 400 Bad Request]:

Required HTTP Headers

Parameter Example Value Description
Content-Type application/json; encoding='utf-8' Sets the request data format. Set 'json' or 'xml' appropriately.
Accept application/json; encoding='utf-8' Sets the return data format. Set 'json' or 'xml' appropriately.
Authorization Basic eyJhbGciOiJI...adQssw5c Auth Token value set up (see Auth Token)

Required URL parameters

Parameter Example Value Description
GroupCode Test-Group Specifies the code or identifier of the group to be deleted.
ContactID 17f2b37e-4706-41c8-8dcb-de90e24c2447 Specifies the unique identifier of the contact to delete.

Versioning/Changelog

When a new version of the API is released, the APIVersion url parameter is incremented.
This allows you to use a different API version based on the API URL, limiting the testing you require should you wish to update one API URL to a later version of the API.

Want to upgrade to a new version for SMS but don't want to break and retest Email? Use the newer APIVersion for SMS while using the older APIVersion for Email.

For example, you may be using:
https://api.bestsms.com.au/api/v2.03/send/email
However, you may also dynamically use:
https://api.bestsms.com.au/api/v2.02/send/email

As new versions of the API are released, this API reference guide will be updated to reflect the latest version and features supported:

 API Version ChangeLog


Frequently Asked Questions

Yes, international delivery is supported. However international delivery is limited to approved accounts only. Please contact us for more details
The maximum request size supported is 20MB. This is our server side limitation. Your client side limitation may be smaller.
There is no limit to the number of Destinations (in either format), provided you do not breach the 20MB maximum REST request size.
SMS messages are sent and charged in blocks of characters. One text message is 160 characters. By default, we will limit your message to three-message-parts in length (459 characters using the GSM character set, or 210 characters using Unicode/UCS-2). This can be increased on request.
Yes, we can provide a daily or monthly email report (as an attached CSV file) containing data on messages sent. This can be used for billing (contains costs) or for reporting (doesn’t contain costs).
Yes, encrypted submissions are accepted across the API via HTTPS. SSL/TLS is also supported for outbound email messages provided the receiving email server supports this.
Some networks support customised SMS Caller IDs. This can be configured using your Web Dashboard.