RESTful API to send SMS
To access the API, you'll need a User with API access:
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.
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 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 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 Accepted400 BAD REQUEST
- Invalid Variables401 Unauthorized
- Invalid Auth Token500 Internal Server Error
- API Server FaultAn 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.Find instructions for each Message Type:
HTTP Method: POST
API URL: https://api.bestsms.com.au/api/v2.03/send/sms
HTTP Method: POST
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) |
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. |
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 |
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
Once a message has been sent, you can retry a failed message, reschedule a delayed message and abort a delayed 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
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) |
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). |
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 |
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
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
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) |
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). |
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 |
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
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
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) |
Parameter | Example Value | Description | |
---|---|---|---|
MessageID | ID123456 | MessageID the Action should apply to |
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 |
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 |
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.
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.
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
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"
}
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>
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
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
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) |
Parameter | Example Value | Description | |
---|---|---|---|
MessageID | ID123456 | Your provided Message ID or BestSMS generated Message ID |
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 |
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 |
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.
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.
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.
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"
}
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>
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
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
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) |
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) |
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 |
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
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
Parameter | Example Value | Description | |
---|---|---|---|
MessageID | ID123456 | Your provided Message ID or BestSMS generated Message ID |
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 |
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
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
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) |
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
API URL: https://api.bestsms.com.au/api/v2.03/addressbook/contact/[ContactID]
HTTP Method: GET
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) |
Parameter | Example Value | Description | |
---|---|---|---|
ContactID | 17f2b37e-4706-41c8-8dcb-de90e24c2447 | Specifies the unique identifier of the contact to retrieve. |
HTTP Method: POST
API URL: https://api.bestsms.com.au/api/v2.03/addressbook/contact
HTTP Method: POST
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) |
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
API URL: https://api.bestsms.com.au/api/v2.03/addressbook/contact/[ContactID]
HTTP Method: PATCH
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) |
Parameter | Example Value | Description | |
---|---|---|---|
ContactID | 17f2b37e-4706-41c8-8dcb-de90e24c2447 | Specifies the unique identifier of the contact to retrieve. |
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
API URL: https://api.bestsms.com.au/api/v2.03/addressbook/contact/[ContactID]
HTTP Method: DELETE
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) |
Parameter | Example Value | Description | |
---|---|---|---|
ContactID | 17f2b37e-4706-41c8-8dcb-de90e24c2447 | Specifies the unique identifier of the contact to retrieve. |
HTTP Method: GET
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
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) |
Parameter | Example Value | Description | |
---|---|---|---|
ContactID | 17f2b37e-4706-41c8-8dcb-de90e24c2447 | Specifies the unique identifier of the contact to retrieve. |
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
API URL: https://api.bestsms.com.au/api/v2.03/addressbook/contact/[ContactID]/group/[Group Code]
HTTP Method: GET
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) |
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
API URL: https://api.bestsms.com.au/api/v2.03/addressbook/contact/[ContactID]/group
HTTP Method: POST
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) |
Parameter | Example Value | Description | |
---|---|---|---|
ContactID | 17f2b37e-4706-41c8-8dcb-de90e24c2447 | Specifies the unique identifier of the contact to create relationship. |
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
API URL: https://api.bestsms.com.au/api/v2.03/addressbook/contact/[ContactID]/group/[GroupCode]
HTTP Method: DELETE
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) |
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
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
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) |
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
API URL: https://api.bestsms.com.au/api/v2.03/addressbook/group/[GroupCode]
HTTP Method: GET
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) |
Parameter | Example Value | Description | |
---|---|---|---|
GroupCode | Test-Group | Specifies the code or identifier of the group to retrieve. |
HTTP Method: POST
API URL: https://api.bestsms.com.au/api/v2.03/addressbook/group
HTTP Method: POST
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) |
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. |
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
API URL: https://api.bestsms.com.au/api/v2.03/addressbook/group/[GroupCode]
HTTP Method: PATCH
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) |
Parameter | Example Value | Description | |
---|---|---|---|
GroupCode | Test-Group | Specifies the code or identifier of the group to be updated. |
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
API URL: https://api.bestsms.com.au/api/v2.03/addressbook/group/[GroupCode]
HTTP Method: DELETE
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) |
Parameter | Example Value | Description | |
---|---|---|---|
GroupCode | Test-Group | Specifies the code or identifier of the group to be deleted. |
HTTP Method: GET
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
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) |
Parameter | Example Value | Description | |
---|---|---|---|
GroupCode | Test-Group | Specifies the code or identifier of the group to be deleted. |
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
API URL: https://api.bestsms.com.au/api/v2.03/addressbook/group/[Group Code]/contact/[ContactID]
HTTP Method: GET
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) |
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
API URL: https://api.bestsms.com.au/api/v2.03/addressbook/group/[GroupCode]/contact
HTTP Method: POST
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) |
Parameter | Example Value | Description | |
---|---|---|---|
GroupCode | Test-Group | Specifies the code or identifier of the group to which the contact relationship should be added. |
Property | Example Value | Description | |
---|---|---|---|
ContactID | 17f2b37e-4706-41c8-8dcb-de90e24c2447 | Specifies the unique identifier of the contact to create relationship. |
HTTP Method: DELETE
API URL: https://api.bestsms.com.au/api/v2.03/addressbook/group/[GroupCode]/contact/[ContactID]
HTTP Method: DELETE
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) |
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. |
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.
https://api.bestsms.com.au/api/v2.03/send/email
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