Batch Personalized Messaging
This endpoint allows you to send personalized 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 see |
personalizedRecipients | Array | Mandatory | Contains objects of recipients and content |
To | String | Mandatory | MSISDNs to receive of message. |
Content | String | Mandatory | Content of the Personalized message |
Sample HTTP Request
POST /v1/messages/batch/personalized/send HTTP/1.1
Host: sms.hubtel.com
Content-Type: application/json
Authorization: Basic cW9vaHF2Y3A6c2dyb3Juam=
{
"From": "AbrantieCo",
"personalizedRecipients": [
{
"To": "233501431586",
"Content": "Hi Pheezy, thank you for all you do for this business"
},
{
"To": "233546335113",
"Content": "Hi Joe, thank you for all you do for this business"
}
]
}
curl --location 'https://sms.hubtel.com/v1/messages/batch/personalized/send' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic ZGJyZibWc6bm5oY3B6cnc=' \
--data '{
"from": "AbrantieCo",
"personalizedRecipients": [
{
"to": "233548359582",
"Content": "Hi Phil, thank you for all you do for this business"
},
{
"to": "233262051132",
"Content": "Hi Abrantie, thank you for all you do for this business"
},
{
"to": "233200585542",
"Content": "Hi Collins, thank you for all you do for this business"
},
{
"to": "233546335113",
"Content": "Hi Joseph, thank you for all you do for this business"
},
{
"to": "233242825109",
"Content": "Hi Felix, thank you for all you do for this business"
}
]
}'
Resonse Parameters
Parameter | Type | Description |
---|---|---|
batchId | String | The ID of the batch of message. |
status | Number | Status code of the request returned by SMS API. |
data | Array | This contains other objects. |
recipient | String | MSISDNs to receive of messages. |
content | String | Content of the simple message. |
messageId | String | Unique identifier of the message. |
Sample Response
{
"batchId": "18ee6a2a-29ac-41c6-b70f-de809b040584",
"status": 0,
"data": [
{
"recipient": "233501431586",
"content": "Hi Pheezy, thank you for all you do for this business",
"messageId": "350fd34d-dce1-4694-a4c9-d9b97d1f4593"
},
{
"recipient": "233546335113",
"content": "Hi Joe, thank you for all you do for this business",
"messageId": "f58e7f2a-203a-4079-a518-7f6647099b5e"
}
]
}
Updated 8 months ago