Skip to content

Repository files navigation

ClickSend Python SDK

Official Python client for the ClickSend API — send and manage SMS, MMS, email, voice, fax, letters, postcards, and more.

Requirements

Python 3.10+

Installation

pip install git+https://github.com/ClickSend/clicksend-python-v2.git

Getting Started

importclicksendfromclicksend.restimportApiExceptionconfiguration=clicksend.Configuration(
username=os.environ["CLICKSEND_USERNAME"],
password=os.environ["CLICKSEND_API_KEY"],
)
withclicksend.ApiClient(configuration) asapi_client:
sms_api=clicksend.SmsApi(api_client)
try:
response=sms_api.send_sms(
send_sms_request={
"messages": [
{"source": "sdk", "body": "Hello from ClickSend!", "to": "+61411111111"}
]
}
)
print(response)
exceptApiExceptionase:
print(f"Exception when calling SmsApi->send_sms: {e}")

More Examples

View account details

withclicksend.ApiClient(configuration) asapi_client:
management_api=clicksend.ManagementApi(api_client)
try:
account=management_api.view_account_details()
print(account)
exceptApiExceptionase:
print(f"Exception when calling ManagementApi->view_account_details: {e}")

Send an MMS

withclicksend.ApiClient(configuration) asapi_client:
mms_api=clicksend.MmsApi(api_client)
try:
response=mms_api.send_mms(
send_mms_request={
"media_file": "https://clicksend.com/logo.png",
"messages": [
{
"to": "+61411111111",
"from": "sdk",
"subject": "Hello",
"body": "Hello from ClickSend!",
"source": "sdk",
}
],
}
)
print(response)
exceptApiExceptionase:
print(f"Exception when calling MmsApi->send_mms: {e}")

Authentication

The API uses HTTP Basic authentication — your ClickSend username and API key (available from the ClickSend Dashboard).

Documentation

Full API reference: https://developers.clicksend.com/docs/rest/v3/

Support

Need help? Contact ClickSend Support or visit the Help Centre.

About

Repo for a new and improved python SDKs

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages