Python
The SMS Bridge API is plain HTTPS and JSON, so you do not need a special package. This example uses the standard HTTP client — it needs Python 3.8+ and the requests package. Official client packages are planned; until then, copy this into your project.
Send an SMS
Put your API key in the SMS_BRIDGE_KEY environment variable, and use one of your paired phone numbers as from_number.
# pip install requests
import os
import requests
res = requests.post(
"https://api.99billingsolutions.com/v1/messages/send",
headers={"x-api-key": os.environ["SMS_BRIDGE_KEY"]},
json={
"from_number": "+15550100001",
"to_number": "+15550100002",
"content": "Your order #A12 has shipped",
},
timeout=15,
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['error_code']}: {body['message']}")
print(body["data"]["id"], body["data"]["status"])Good practice
- Keep the key on your server, never in browser or app code.
- Pass a unique
request_idper message, so retrying after a timeout can never send twice. - On
429, wait for theRetry-Afterseconds before retrying. - Receive replies and delivery updates with webhooks and verify their signature.