Batch Simple Messaging
This endpoint allows you to send messages to a group of people. You’ll need to make an HTTP POST and also authenticate your request with the Basic Auth of your SMS API credentials.
Request Parameters
Parameter | Type | Requirement | Description |
---|---|---|---|
From | String | Mandatory | SenderId or Name recipients will see. |
Recipients | Array | Mandatory | MSISDNs to receive of message. |
Content | String | Mandatory | Content of the simple message |
Sample HTTP Request
POST /v1/messages/batch/simple/send HTTP/1.1
Host: sms.hubtel.com
Content-Type: application/json
Authorization: Basic cW9vaHF2Y3A6c2dyb3Juam=
{
"From": "AbrantieLai",
"Recipients": [
"233546335113",
"233501431586"
],
"Content": "Welcome to the first ever bulk SMS via API in Ghana"
}
curl --location 'https://sms.hubtel.com/v1/messages/batch/simple/send' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic ZyZXRibWc6bm5oY3B6cnc=' \
--data '{
"From": "AbrantieLai",
"Recipients": [
"233546335113",
"233501431586"
],
"Content": "Welcome to the first ever bulk SMS via API in Ghana"
}'
Response Parameters
Parameter | Type | Description |
---|---|---|
batchId | String | The ID of the batch of messages |
status | Number | Status code of the request returned by SMS API |
data | Array | This contains other objects. |
recipient | String | MSISDNs to receive of message. |
content | String | Content of the simple message |
messageId | String | Unique identifier of message |
Sample Response
{
"batchId": "165949ee-431b-4bf8-9eca-108058a8bc32",
"status": 0,
"data": [
{
"recipient": "233546335113",
"content": "Welcome to the first ever bulk SMS via API in Ghana",
"messageId": "e80133f9-e822-457c-98fb-d217bc4a1f83"
},
{
"recipient": "233501431586",
"content": "Welcome to the first ever bulk SMS via API in Ghana",
"messageId": "ebc7948a-7c81-4396-9104-9c99fc921069"
}
]
}
Updated 8 months ago