Using a single Python library, Python developers can send SMS messages using their own software.
If you don't have an account, head to https://bestsms.au/signup and fill in the form.
To access the API, you'll need a User with API access:
At any time, you can refresh your Auth Token by clicking the button and exporting your new Auth Token. This action will invalidate any apps using your old Auth Token.
Auth Tokens can be used for multiple use-cases, with SubAccount and Department values helping in tracking reporting and billing.
API v2.04 utilises JWT token Authentication. For OAuth2 authentication options, contact your BestSMS representative.
Save hundreds of lines of code and hours of time by add the BestSMS Python library into your project. Using one package and simple code tweaks, your software can send SMS messages.
Download and install the 'bestsms' using pip: pip install bestsms
Reference the library in your code: from bestsms import BestSMS
Using the [request].SendMessage() function, the package will connect to BestSMS's REST API (in JSON format) and send messages.
Message Status and Received Messages can be captured using a Webhook (a POST to your nominated URL), or can be Polled for using the Library's [request].Poll() function.
See Status Reporting and Receive Messages.
Find instructions for each Message Type:
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Messaging.SMS.SendMessage(
Reference = "Test", # Optional
MessageText = "Test SMS", # SMS Message
Recipients = [ # Recipient
"+61421111111",
"+61422222222"
]
)
print(response)
from bestsms import BestSMS
from bestsms.api.addressbook.contacts.dtos.contact_model import ContactModel
from bestsms.api.addressbook.groups.dtos.group_model import GroupModel
from bestsms.api.messaging.dtos.recipient_model import RecipientModel
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Messaging.SMS.SendMessage(
MessageID = "ID12345", # Your custom MessageID
Reference = "Test SMS - Advanced version", # Reference
SMSEmailReply = "[email protected]", # Email address to receive reply back
ForceGSMChars = True, # Convert multi-byte characters into normalised GSM character
MessageText = "Test SMS Message for [[Attention]] at [[Company]]. Click [[Reply]] to reply.",
Recipients = [
"+61421000001", # Mobile Number
{
"Recipient": "+61421000002", # Recipient Mobile Number
"Company": "Example Corp", # Company Name
"Attention": "John Doe", # Attention
"First Name": "John",
"Last Name": "Doe",
"Custom1": "",
"Custom2": ""
},
{
"GroupID": "4000000b-f002-4007-b00a-c00000000001"
},
{
"ContactID": "6000000b-f002-4007-b00a-c00000000002"
},
RecipientModel(
Recipient = "+61421000003", # Recipient Mobile Number
Company = "Test Company 2", # Company Name
Attention = "Test Recipient 2", # Attention
Custom1 = "Custom1", # Custom Field
Custom2 = "Custom2",
Custom3 = "Custom3",
Custom4 = "Custom4",
Custom5 = "Custom5"
),
GroupModel (
GroupID = "4000000b-f002-4007-b00a-c00000000003"
),
ContactModel (
ContactID = "6000000b-f002-4007-b00a-c00000000004"
),
RecipientModel(
ContactID = "6000000b-f002-4007-b00a-c00000000005"
)
]
)
print(response)
| Parameter | Example Value | Description | |
|---|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token | |
| MessageText | Hello, this is a test message from Department01. Thank you. | Plain or UTF-8 formatted SMS message | |
| Recipients | +61421000002 | Mobile number to receive the message (for detailed formatting, see the Destinations parameter below) | |
| Parameter | Example Value | Description | |
|---|---|---|---|
| MessageID | ID12345 | 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). | |
| SendTime | new DateTime() | Delay sending until the specified date/time (YYYY-MM-DD HH:mm 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, short code(s) will override in Australia. | |
| SMSEmailReply | [email protected] | For email (SMTP) reply receipt notifications | |
| ForceGSMChars | True | Convert multi-byte characters into normalised GSM character format. ie. © to (C) | |
| Message | Hi Jess, your Happy Fitness membership renewal is due next week. Reply YES to renew or call (03) 9876 5432 for any questions. Reply STOP to opt out. | An example Message | |
| Recipients | > Recipient | +61421000001 | Recipient of the SMS in E.164 internationalised format |
| > Attention | John Doe | Recipient's friendly name | |
| > Company | Example Corp | Recipient's company | |
| > Custom1 | Customisable field | ||
| > Custom2 | Customisable field | ||
Under request object you can specify an additional SendMode=Test parameter.
SendMode=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.
# Test mode
request.SendMode = "Test"
Once a message has been sent, you can retry a failed message, reschedule a delayed message, abort a delayed message and edit the NumberOfOperators value on Voice/TTS messages.
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.
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Actions.Resubmit.SendRequest(
MessageID="ID123456" # MessageID generated from system OR your message ID if specified
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Actions.Resubmit.SendRequest(
MessageID="ID123456" # MessageID generated from system OR your message ID if specified
SendTime="2025-08-10 09:00" # Date/Time to resend
)
print(response)
| Parameter | Example Value | Description | |
|---|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token | |
| 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) | |
| Status | Transmit | Current Status of your message | |
| JobNum | ABCD1234 | Your Job Number | |
| Action | Resubmit | What action (Resubmit) was requested | |
| ErrorMessage | Missing Sender | Reason for the API call failure | |
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.
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Actions.Reschedule.SendRequest(
MessageID="ID123456" # MessageID generated from system OR your message ID if specified
SendTime="2025-08-12 12:00:00" # New Date/Time
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Actions.Reschedule.SendRequest(
MessageID="ID123456" # MessageID generated from system OR your message ID if specified
SendTime="2025-08-12 12:00:00" # New Date/Time
)
print(response)
| Parameter | Example Value | Description | |
|---|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token | |
| MessageID | ID123456 | MessageID the Action should apply to | |
| SendTime | 2020-05-12 14:05:00 | Reschedule sending for the specified date/time (YYYY-MM-DD HH:mm in your Account/Sender's default timezone setting) | |
| Parameter | Example Value | Description | |
|---|---|---|---|
| Result | Success | Result of your API call (not the result of the message) | |
| Status | Delayed | Current Status of your message | |
| JobNum | ABCD1234 | Your Job Number | |
| Action | Reschedule | What action (Reschedule) was requested | |
| ErrorMessage | Missing Sender | Reason for the API call failure | |
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.
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Actions.Abort.SendRequest(
MessageID="ID123456", # MessageID generated from system OR your message ID if specified
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Actions.Abort.SendRequest(
MessageID="ID123456", # MessageID generated from system OR your message ID if specified
)
print(response)
| Parameter | Example Value | Description | |
|---|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token | |
| 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) | |
| Status | Pending | Current Status of your message | |
| JobNum | ABCD1234 | Your Job Number | |
| Action | Abort | What action (Abort) was requested | |
| ErrorMessage | Missing Sender | 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.
The email address to receive SMS Reply reports can be specified on the original message submission using the SMSEmailReply parameter.
If you are set up to receive Status webhooks, you will also be receiving SMS Received webhooks.
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).
Webhook failures are retried every five minutes for a maximum of 24 hours.
Supplied parameters are:
| Parameter | Example Value | Description | |
|---|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token | |
| Type | SMS | Type of Message | |
| 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/2018 13:43 p.m. | Time message was completed (Sender's local time time in 'YYYY-MM-DD 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 For a list of possible values, see SMS. For reply reports, this will be RECEIVED For additional analytics, this will be the event description |
|
| Message | Field will be blank; it is used by the Receive Messages webhook only | ||
| Price | 0.20 | Your cost for this transaction, charged by us to you | |
| Detail | SMSParts:2 | Additional billing detail: "SMSParts" | |
| URL | https://www.example.com/webhook | The URL this webhook is sent to | |
| RESPONSEMODE | JSON | This webhook's format | |
You are able to poll for the status of a message via the GET Status API.
The Poll should be configured to timeout after 48 hours with no result.
Reference : BestSMS.Messaging.Get
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Reports.Status.Poll(
MessageID="ID123456" # MessageID generated from system OR your message ID if specified
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Reports.Status.Poll(
MessageID="ID123456" # MessageID generated from system OR your message ID if specified
)
print(response)
| Parameter | Example Value | Description | |
|---|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token | |
| MessageID | ID123456 | Your provided Message ID or BestSMS generated Message ID | |
Currently, tracking SMS Received is supported.
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.
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.
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).
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.
Supplied parameters are:
| Parameter | Example Value | Description | |
|---|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token | |
| Type | SMSReply | Type of Message ('SMS', 'SMSInbound' or 'SMSReply') | |
| Destination | +61421000001 | Mobile number sending the SMS message (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/2018 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", 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 | |
You are able to poll for all received SMS messages in a given time-frame.
The Poll should be configured to timeout after 48 hours with no result.
Reference : BestSMS.Messaging.Get
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Reports.SMSReceived.Poll(
TimePeriod = 1440 # Return results from the last x minutes
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Reports.SMSReceived.Poll(
DateFrom = "2025-08-01 00:00:00", # Return results from the date/time
DateTo = "2025-08-31 23:59:59", # Return results to the date/time
RecordsPerPage = 10, # x numbers of records to return per request
Page = 1 # current location
)
print(response)
| Parameter | Example Value | Description | |
|---|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token | |
| TimePeriod | 1440 | Return results from the last x minutes | |
| DateFrom | 2022-08-01T00:00:00 | Return results from the specified date (optional) | |
| DateTo | 2022-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) | |
| ReceivedMessages | SMSReceivedMessage | List of SMS messages received | |
| ErrorMessage | Missing Sender | Reason for the API call failure | |
| Parameter | Example Value | Description | |
|---|---|---|---|
| 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 | |
You are able to poll for replies to a specific SMS message, tracked using the MessageID on the outbound message.
The Poll should be configured to timeout after 48 hours with no result.
Reference : BestSMS.Messaging.Get
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Reports.SMSReply.Poll(
MessageID="ID123456" # MessageID generated from system OR your message ID if specified
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Reports.SMSReply.Poll(
MessageID="ID123456" # MessageID generated from system OR your message ID if specified
)
print(response)
| Parameter | Example Value | Description | |
|---|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token | |
| 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 | Status of your job | |
| MessageID | AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD | Your provided Message ID or BestSMS generated Message ID | |
| 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 | ||
| SentMessage | SMSSentMessage Object | Details of your sent message | |
| ReceivedMessages | SMSReceivedMessage Objects | Details of your received message(s) | |
| ErrorMessage | Missing Sender | Reason for the API call failure | |
| Parameter | Example Value | Description | |
|---|---|---|---|
| Date | 2019-12-01 14:02:03 | Date/Time SMS was received (yyyy-mm-dd HH:mm:ss) | |
| Destination | 6421000001 | 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 | |
| Parameter | Example Value | Description | |
|---|---|---|---|
| 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 | |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Contact.List(
Page=1
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Contact.List(
RecordsPerPage=10,
Page= 1
)
print(response)
| Parameter | Example Value | Description | |
|---|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API 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. | |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call (not the result of the message) |
| TotalRecords | int | 3 | Total number of contacts |
| RecordsPerPage | int | 100 | Return x number of records per request (optional) |
| PageCount | int | 1 | Maximum number of pages |
| Page | int | 1 | Current location of the result set (optional) |
| Contacts | list[ContactModel] | ContactModel | List of contacts |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Contact.Detail(
ContactID="AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Contact.Detail(
ContactID="AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD"
)
print(response)
| Parameter | Example Value | Description |
|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token |
| ContactID | AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD | Specifies the unique identifier of the contact to retrieve. |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call (not the result of the message) |
| Contact | ContactModel | ContactModel object | Contact detail |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
| Property | Type | Example Value | Description |
|---|---|---|---|
| ID | str | AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD | Unique identifier for the contact |
| Owner | str | COM\EXAMPLE\TEST | Your UserKey |
| Created | datetime | 2025-12-01T12:00:00 | Creation date for this contact in your local date/time |
| CreatedUTC | datetime | 2025-12-01T00:00:00 | Creation date for this contact in UTC date/time |
| Updated | datetime | 2025-12-01T12:00:00 | Last updated date for this contact in your local date/time |
| UpdatedUTC | datetime | 2025-12-01T00:00:00 | Last updated date for this contact in UTC date/time |
| Timezone | str | AUS Eastern | Timezone associated with Created/Updated date/time |
| Attention | str | Person Attention | Indicates the attention or focus associated with the contact. |
| Title | str | Ms | Represents the title or honorific of the contact (e.g., Mr, Mrs, Ms). |
| Company | str | BestSMS Australia | Specifies the company or organization associated with the contact. |
| CompanyDepartment | str | Sales Dept. | Indicates the department or division within the company associated with the contact. |
| FirstName | str | Person first name | Represents the first name of the contact. |
| LastName | str | Person last name | Represents the last name of the contact. |
| Position | str | Sales Represent | Specifies the job position or role of the contact. |
| StreetAddress | str | Sales Represent | Represents the street address or location of the contact. |
| Suburb | str | My Suburb | Specifies the suburb or district associated with the contact's address. |
| City | str | Auckland | Indicates the city or locality associated with the contact's address. |
| State | str | AKL | Represents the state or province associated with the contact's address. |
| Country | str | AUS Eastern | Specifies the country associated with the contact's address. |
| Postcode | str | 1234 | Represents the postal code or ZIP code associated with the contact's address. |
| MainPhone | str | 092223333 | Specifies the main phone number of the contact. This property typically used for Voice & Text-To-Speech messages. |
| AltPhone1 | str | 093334444 | Represents an alternate phone number for the contact. This property typically used for Voice & Text-To-Speech messages. |
| AltPhone2 | str | 094445555 | Represents a second alternate phone number for the contact. This property typically used for Voice & Text-To-Speech messages. |
| DirectPhone | str | 094445555 | Indicates the direct phone number of the contact. |
| MobilePhone | str | 0211144489 | Represents the mobile phone number of the contact. This property typically used for SMS messages. |
| FaxNumber | str | 093334444 | Specifies the fax number associated with the contact. |
| EmailAddress | str | [email protected] | Represents the email address of the contact. |
| WebAddress | str | https://bestsms.au | Specifies the website address or URL associated with the contact. |
| Custom1...4 | str | Custom Value | Represents custom fields or additional information associated with the contact. |
| ViewBy | str | Account | Specifies the visibility of the contact. Values can be "Account", "SubAccount", "Department" or "No" visibility option. |
| EditBy | str | Account | Specifies the permission level required to edit the contact. Values can be "Account", "SubAccount", "Department" or "No" permission option. |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Contact.Create(
Attention="Test Person",
FirstName="First",
LastName="Last",
MobilePhone="+61421000001",
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Contact.Create(
Title="Mr",
Company="BestSMS Australia",
FirstName="First",
LastName="Last",
MobilePhone="+61421000001",
ViewPublic="Account",
EditPublic="Account"
)
print(response)
| Parameter | Example Value | Description | |
|---|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token | |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call (not the result of the message) |
| Contact | ContactModel | ContactModel object | Contact detail |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Contact.Update(
ContactID="AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD",
Attention="Test Attention"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Contact.Update(
ContactID="AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD",
Attention="Test Attention"
Title="Mr",
Company="BestSMS Australia",
FirstName="First",
LastName="Last",
MobilePhone="+614213334444",
ViewPublic="Account",
EditPublid="Account"
)
print(response)
| Parameter | Example Value | Description | |
|---|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token | |
| ContactID | AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD | Specifies the unique identifier of the contact to update. | |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call (not the result of the message) |
| Contact | ContactModel | ContactModel object | Contact detail |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Contact.Delete(
ContactID="AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Contact.Delete(
ContactID="AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD"
)
print(response)
| Parameter | Example Value | Description | |
|---|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token | |
| ContactID | AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD | Specifies the unique identifier of the contact to delete. | |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call (not the result of the message) |
| Contact | ContactModel | ContactModel object | Contact detail |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.ContactGroup.List(
Page=1,
ContactID="AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.ContactGroup.List(
RecordsPerPage=10,
Page=1,
ContactID="AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD"
)
print(response)
| Parameter | Example Value | Description |
|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token |
| ContactID | AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD | Specifies the unique identifier of the contact to retrieve. (required) |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call |
| TotalRecords | int | 3 | Total number of groups associated with this contact |
| RecordsPerPage | int | 100 | Return x number of records per request (optional) |
| PageCount | int | 1 | Maximum number of pages |
| Page | int | 1 | Current location of the result set (optional) |
| Contact | ContactModel | ContactModel object | Contact detail |
| Groups | list[GroupModel] | GroupModel list | List of groups associated with this contact |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.ContactGroup.Detail(
ContactID="AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD",
GroupCode="Test_Group"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.ContactGroup.Detail(
ContactID="AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD",
GroupCode="Test_Group"
)
print(response)
| Parameter | Example Value | Description |
|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token |
| ContactID | AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD | Specifies the unique identifier of the contact to retrieve. (required) |
| GroupID | BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF | Specifies the unique identifier of the group to retrieve. (required) |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call (not the result of the message) |
| Contact | ContactModel | ContactModel object | Contact detail |
| Group | GroupModel | GroupModel object | Group detail |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.ContactGroup.Create(
ContactID = "AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD",
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.ContactGroup.Create(
ContactID = "AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD",
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF"
)
print(response)
| Parameter | Example Value | Description |
|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token |
| ContactID | AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD | Specifies the unique identifier of the contact to create. (required) |
| GroupID | BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF | Specifies the unique identifier of the group to create. (required) |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call |
| Contact | ContactModel | ContactModel object | Contact detail |
| Group | GroupModel | GroupModel object | Group detail |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.ContactGroup.Delete(
ContactID = "AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD",
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.ContactGroup.Delete(
ContactID = "AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD",
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF"
)
print(response)
| Parameter | Example Value | Description |
|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token |
| ContactID | AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD | Specifies the unique identifier of the contact to delete. (required) |
| GroupID | BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF | Specifies the unique identifier of the group to delete. (required) |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call |
| Contact | ContactModel | ContactModel object | Contact detail |
| Group | GroupModel | GroupModel object | Group detail |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Group.List(
Page=1
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Group.List(
RecordsPerPage=10,
Page=1
)
print(response)
| Parameter | Example Value | Description | |
|---|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API 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. | |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call (not the result of the message) |
| TotalRecords | int | 3 | Total number of records |
| RecordsPerPage | int | 100 | Return x number of records per request (optional) |
| PageCount | int | 1 | Maximum number of pages |
| Page | int | 1 | Current location of the result set (optional) |
| Groups | list[GroupModel] | GroupModel | List of group |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Group.Detail(
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Group.Detail(
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF"
)
print(response)
| Parameter | Example Value | Description |
|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token |
| GroupID | BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF | Specifies the unique identifier of the group to retrieve. (required) |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call |
| Group | GroupModel | GroupModel object | Group detail |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
| Property | Type | Example Value | Description |
|---|---|---|---|
| GroupID | str | BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF | Unique identifier for the group (required) |
| GroupName | str | Test Group | Represents the name of the group. |
| SubAccount | str | SubAccount01 | Used for reporting, billing and Web Dashboard segmentation. |
| Department | str | Department01 | Used for reporting, billing and Web Dashboard segmentation. |
| ViewEditBy | str | Account | Specifies the permission level required to view/edit the group. Values can be "Account", "SubAccount", "Department" or "No" permission option. |
| Owner | str | COM\EXAMPLE\TEST | Your UserKey |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Group.Create(
GroupCode="Test-Group",
GroupName="Test Group"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Group.Create(
GroupCode="Test-Group",
GroupName="Test Group"
)
print(response)
| Parameter | Example Value | Description |
|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token |
| GroupID | BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF | Specifies the unique identifier of the group to create. (required) |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call |
| Group | GroupModel | GroupModel object | Group detail |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Group.Update(
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF", # Required
GroupCode = "Test_Group",
GroupName = "Test Group 123"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Group.Update(
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF", # Required
GroupCode = "Test_Group",
GroupName = "Test Group 123"
)
print(response)
| Parameter | Example Value | Description |
|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token |
| GroupID | BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF | Specifies the unique identifier of the group to update. (required) |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call |
| Group | GroupModel | GroupModel object | Group detail |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Group.Delete(
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF", # Required
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.Group.Delete(
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF", # Required
)
print(response)
| Parameter | Example Value | Description |
|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token |
| GroupID | BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF | Specifies the unique identifier of the group to delete. (required) |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call |
| Group | GroupModel | GroupModel object | Group detail |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.GroupContact.List(
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF", # Required
Page = 1
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.GroupContact.List(
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF", # Required
RecordsPerPage = 10,
Page = 1
)
print(response)
| Parameter | Example Value | Description |
|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token |
| GroupID | BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF | Specifies the unique identifier of the group to retrieve. (required) |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call |
| TotalRecords | int | 3 | Total number of groups associated with this contact |
| RecordsPerPage | int | 100 | Return x number of records per request (optional) |
| PageCount | int | 1 | Maximum number of pages |
| Page | int | 1 | Current location of the result set (optional) |
| Group | GroupModel | GroupModel object | Group detail |
| Contacts | list[ContactModel] | ContactModel list | List of contacts associated with this group |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.ContactGroup.Create(
ContactID = "AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD",
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.ContactGroup.Create(
ContactID = "AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD",
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF"
)
print(response)
| Parameter | Example Value | Description |
|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token |
| GroupID | BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF | Specifies the unique identifier of the group to retrieve. (required) |
| ContactID | AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD | Specifies the unique identifier of the contact to retrieve. (required) |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call |
| Group | GroupModel | GroupModel object | Group detail |
| Contact | ContactModel | ContactModel object | Contact detail |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.GroupContact.Create(
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF", # Required
ContactID = "AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD" # Required
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.GroupContact.Create(
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF", # Required
ContactID = "AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD" # Required
)
print(response)
| Parameter | Example Value | Description |
|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token |
| GroupID | BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF | Specifies the unique identifier of the group to create. (required) |
| ContactID | AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD | Specifies the unique identifier of the contact to create. (required) |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call |
| Group | GroupModel | GroupModel object | Group detail |
| Contact | ContactModel | ContactModel object | Contact detail |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.GroupContact.Delete(
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF", # Required
ContactID = "AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD" # Required
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]" # Auth Token
)
response = client.Addressbook.GroupContact.Delete(
GroupID = "BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF", # Required
ContactID = "AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD" # Required
)
print(response)
| Parameter | Example Value | Description |
|---|---|---|
| AuthToken | eyJhbGciOiJI...adQssw5c | Auth Token value set up in Create a new API Auth token |
| GroupID | BBBBBBBB-CCCC-DDDD-EEEE-FFFFFFFFFFFF | Specifies the unique identifier of the group to delete. (required) |
| ContactID | AAAAAAAA-BBBB-BBBB-CCCC-DDDDDDDDDDDD | Specifies the unique identifier of the contact to delete. (required) |
| Property | Type | Example Value | Description |
|---|---|---|---|
| Result | str | Success | Result of your API call |
| Group | GroupModel | GroupModel object | Group detail |
| Contact | ContactModel | ContactModel object | Contact detail |
| ErrorMessage | list[str] | Missing Sender | Reason for the API call failure |
As new versions of the APIs are released, this API reference guide will be updated to reflect the latest version and features supported:
API Version ChangeLog