Python SDK
Coming Soon
The official Python SDK is under development. In the meantime, use the REST API directly.
Preview
The Python SDK will provide a clean, typed interface:
python
from cubeconnect import CubeConnect
cube = CubeConnect("YOUR_API_KEY")
# Send a text message
result = cube.messages.send_text("+966501234567", "Hello!")
# Send a template
result = cube.messages.send_template(
"+966501234567",
"order_confirmation",
params=["ORD-1234", "500 SAR"],
)
# Check result
print(result.message_log_id)
print(result.status) # "queued"Requirements
- Python 3.9+
httpxorrequests
Installation (Coming Soon)
bash
pip install cubeconnectCurrent Alternative
Use requests or httpx:
python
import requests
response = requests.post(
"https://cubeconnect.io/api/v1/messages/send",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"phone": "+966501234567",
"message_type": "text",
"data": {"body": "Hello!"},
},
)See the API Reference for the complete API specification.