
Security News
Crates.io Implements Trusted Publishing Support
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
The documentation for the BestSMS API can be found here.
bestsms
uses a modified version of Semantic Versioning for all changes. See this document for details.
This library supports the following Python implementations:
Install from PyPi using pip, a package manager for Python.
pip install bestsms
Don't have pip installed? Try installing it, by running this from the command line:
$ curl https://raw.github.com/pypa/pip/master/contrib/get-pip.py | python
python setup.py install
You may need to run the above commands with sudo
.
Getting started with the BestSMS API couldn't be easier. Create a
Client
and you're ready to go.
The BestSMS
needs your BestSMS API credentials (BestSMS Auth Tokens). You can either pass these
directly to the constructor (see the code below) or via environment variables.
from bestsms import BestSMS
client = BestSMS(
AuthToken = "[Your Auth Token]"
)
Send SMS through bestsms
library.
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Messaging.SMS.SendMessage(
Reference="Test",
MessageText = "Test SMS Message click [[Reply]] to opt out",
Recipients = ["+61421123123"],
)
print(response)
Retrieve your message status using bestsms
library.
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Reports.Status.Poll(
MessageID="ID123456"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
request = client.Reports.SMSReply.Poll(
MessageID="ID123456"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Reports.SMSReceived.Poll(
#TimePeriod = 1440
DateFrom="2023-07-01 00:00:00",
DateTo="2023-08-01 00:00:00"
)
print(response)
Amend your message using bestsms
library.
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Actions.Abort.SendRequest(
MessageID="ID123456"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Actions.Resubmit.SendRequest(
MessageID="ID123456",
SendTime="2023-07-10T09:00" #optional
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Actions.Reschedule.SendRequest(
MessageID="ID123456",
SendTime=datetime.now()
)
print(response)
Manage your contacts using bestsms
library.
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.Contact.List(
RecordsPerPage=10,
Page=1
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.Contact.Detail(
ContactID="[Contact ID]"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.Contact.Create(
Title="Mr",
Company="BestSMS",
FirstName="First",
LastName="Last",
MobilePhone="+61421222233",
ViewPublic="Account",
EditPublid="Account"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.Contact.Update(
ContactID="[Contact ID]",
Attention="Test Attention"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.Contact.Delete(
ContactID="[Contact ID]"
)
print(response)
Manage your contact group relationship using bestsms
library.
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.ContactGroup.List(
RecordsPerPage=10,
Page=1,
ContactID="[Contact ID]"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.ContactGroup.Detail(
ContactID="[Contact ID]",
GroupCode="[Group Code]"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.ContactGroup.Create(
ContactID="[Contact ID]",
GroupCode="[Group Code]"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.ContactGroup.Delete(
ContactID="[Contact ID]",
GroupCode="[Group Code]"
)
print(response)
Manage your group using bestsms
library.
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.Group.List(
RecordsPerPage=10,
Page=1
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.Group.Detail(
GroupCode="[Group Code]"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.Group.Create(
GroupCode="[Group Code]",
GroupName="[Group Name]"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.Group.Update(
GroupCode="[Group Code]",
GroupName="[Group Name]"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.Group.Delete(
GroupCode="[Group Code]"
)
print(response)
Manage your group contact relationship using bestsms
library.
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.GroupContact.List(
RecordsPerPage=10,
Page=1,
GroupCode="[Group Code]"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.GroupContact.Detail(
GroupCode="[Group Code]",
ContactID="[Contact ID]"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.GroupContact.Create(
GroupCode="[Group Code]",
ContactID="[Contact ID]"
)
print(response)
from bestsms import BestSMS
client = BestSMS(
AuthToken="[Your Auth Token]"
)
response = client.Addressbook.GroupContact.Delete(
GroupCode="[Group Code]",
ContactID="[Contact ID]"
)
print(response)
If you need help installing or using the library, please check the BestSMS Contact if you don't find an answer to your question.
FAQs
BestSMS REST API Helper Library for Python
We found that bestsms demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.