Overview
Authentication
Example
import requests
# Define your API token, service plan ID, and the URL
api_token = "{YOUR_API_Token}"
url = f"https://app.9bits.net:2096/ng/v1/sendsms"
# Define the payload data in a Python dictionary
data = {
"from": "myCode",
"to": ["2348020000000"],
"content": "Hi buddy! How are you today?"
}
# 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)
SMS REST formats and conventions
JSON
Phone numbers (MSISDN)
Last updated