Batches

Batches are sets of SMS messages. You can send a single message or many. Batches are queued and sent at the rate limit in FIFO (first-in-first-out) order.

Send

The first step is to set a webhook URL at Webhook tab under Settings, to ensure receipt of all DLRs (delivery reports).

Depending on the length of the body, one message might be split into multiple parts and charged accordingly.

POST https://app.9bits.net/api/v1/sendsms

Headers

NameTypeDescription

Authorization*

Bearer <YOUR_TOKEN_HERE>

Content-Type*

application/json

Request Body

NameTypeDescription

from*

myCode

body*

Hello Buddy. Let's go!

to*

2348020000000

Request sample

import requests

url = "https://app.9bits.net/api/v1/sendsms"

payload = {
  "from": "Your_sender_ID",
  "to": [
    "Recipient_number"
  ],
  "body": "Your_message",
  "delivery_report": "none"
}

headers = {
  "Content-Type": "application/json",
  "Authorization": "Bearer <YOUR_TOKEN_HERE>"
}

response = requests.post(url, json=payload, headers=headers)

data = response.json()
print(data)
Response sample

{
    "reference_id": "01FC66621XXXXX119Z8PMV1QPQ",
    "to": ["8020000000","8030000000"],
    "from": "myCode",
    "body": "Hi! How are you?",
    "created_at": "2022-03-24 14:15:22",
    "send_at": "2022-03-24 17:15:22",
    "delivery_report": "none"
}

REQUEST AND RESPONSE BODY SCHEMA: application/json

body (required) The message content.

to (required) List of Phone numbers and group IDs that will receive the batch.

from (required) Sender number. Must be an alphanumeric ID that was registered on the web portal.

delivery_report Default: "none". Request delivery report callback. Note that delivery reports can be fetched from the API regardless of this setting.

Description

none

No delivery report callback will be sent

yes

A delivery report callback will be sent for each status change of a message. These delivery reports also include a timestamp of when the Delivery Report originated from the SMSC.

send_at If set in the future, the message will be delayed until send_at occurs. If set in the past, messages will be sent immediately.

reference_id A unique reference for each transaction.

created_at Timestamp for when batch was created.