Overview
Send SMS
Example
import requests
api_token = "{YOUR_API_Token}"
url = f"https://app.9bits.net:2081/ng/v1/sendsms"
# Define the payload data in a Python dictionary
data = {
"from": "48974",
"to": "2348020000000",
"message": "When was the last time you went to the cinema?",
"session_id": "67543uhn3",
"sent_date": "2024-01-02T23:50:37.000000Z"
}
# Define headers with authorization and content type
headers = {
"Authorization": f"Bearer {api_token}",
"Content-Type": "application/json"
}
# Send the POST request
response = requests.post(url, json=data, headers=headers)
# Check the response
if response.status_code == 200:
print("Request was successful.")
print(response.json())
else:
print(f"Request failed with status code: {response.status_code}")
print(response.text)
Receive SMS
Example
SMS REST formats and conventions
JSON
Phone numbers (MSISDN)
Last updated