SMS API
Bwatmesaj SMS API allows you to send and receive SMS messages to and from any country in the world through a REST API. Each message is identified by a unique random ID so that users can always check the status of a message using the given endpoint.
API Endpoint
https://main.bwatmesaj.com/api/v3/sms/send
Parameter | Required | Description |
---|---|---|
Authorization | Yes | When calling our API, send your api token with the authentication type set as Bearer (Example: Authorization: Bearer {api_token} ) |
Accept | Yes | Set to application/json |
Bwatmesaj’s Programmable SMS API enables you to programmatically send SMS messages from your web application. First, you need to create a new message object. Bwatmesaj returns the created message object with each request.
Send your first SMS message with this example request.
API Endpoint
https://main.bwatmesaj.com/api/v3/sms/send
Parameter | Required | Type | Description |
---|---|---|---|
recipient | Yes | string | Number to send message. Use comma (,) to send multiple numbers. Ex. 31612345678,8801721970168 |
sender_id | Yes | string | The sender of the message. This can be a telephone number (including country code) or an alphanumeric string. In case of an alphanumeric string, the maximum length is 11 characters. |
type | Yes | string | The type of the message. For text message you have to insert plain as sms type. |
message | Yes | string | The body of the SMS message. |
schedule_time | No | datetime | The scheduled date and time of the message in RFC3339 format (Y-m-d H:i) |
dlt_template_id | No | string | The ID of your registered DLT (Distributed Ledger Technology) content template. |
Example request for Single Number
curl -X POST https://main.bwatmesaj.com/api/v3/sms/send \
-H 'Authorization: Bearer 13|4j99SlsIaRf5Zh2X5QIFAFRREuPCMqBYsSBGFnbP5fbfe1ca' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"recipient":"31612345678",
"sender_id":"YourName",
"type":"plain",
"message":"This is a test message"
}'
curl -X POST https://main.bwatmesaj.com/api/v3/sms/send \
-H 'Authorization: Bearer 13|4j99SlsIaRf5Zh2X5QIFAFRREuPCMqBYsSBGFnbP5fbfe1ca' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"recipient":"31612345678,880172145789",
"sender_id":"YourName",
"type":"plain",
"message":"This is a test message",
"schedule_time=2021-12-20 07:00"
}'
Returns a contact object if the request was successful.
{
"status": "success",
"data": "sms reports with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
Bwatmesaj’s Programmable SMS API enables you to programmatically send Campaigns from your web application. First, you need to create a new message object. Bwatmesaj returns the created message object with each request.
Send your first Campaign Using Contact List with this example request.
API Endpoint
https://main.bwatmesaj.com/api/v3/sms/campaign
Parameter | Required | Type | Description |
---|---|---|---|
contact_list_id | Yes | string | Contact list to send message. Use comma (,) to send multiple contact lists. Ex. 6415907d0d7a6,6415907d0d37a |
sender_id | Yes | string | The sender of the message. This can be a telephone number (including country code) or an alphanumeric string. In case of an alphanumeric string, the maximum length is 11 characters. |
type | Yes | string | The type of the message. For text message you have to insert plain as sms type. |
message | Yes | string | The body of the SMS message. |
schedule_time | No | datetime | The scheduled date and time of the message in RFC3339 format (Y-m-d H:i) |
dlt_template_id | No | string | The ID of your registered DLT (Distributed Ledger Technology) content template. |
curl -X POST https://main.bwatmesaj.com/api/v3/sms/campaign \
-H 'Authorization: Bearer 13|4j99SlsIaRf5Zh2X5QIFAFRREuPCMqBYsSBGFnbP5fbfe1ca' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"recipient":"6415907d0d37a",
"sender_id":"YourName",
"type":"plain",
"message":"This is a test message"
}'
curl -X POST https://main.bwatmesaj.com/api/v3/sms/campaign \
-H 'Authorization: Bearer 13|4j99SlsIaRf5Zh2X5QIFAFRREuPCMqBYsSBGFnbP5fbfe1ca' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"recipient":"6415907d0d37a,6415907d0d7a6",
"sender_id":"YourName",
"type":"plain",
"message":"This is a test message",
"schedule_time=2021-12-20 07:00"
}'
Returns a contact object if the request was successful.
{
"status": "success",
"data": "campaign reports with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
You can use Bwatmesaj’s SMS API to retrieve information of an existing inbound or outbound SMS message.
You only need to supply the unique message id that was returned upon creation or receiving.
API Endpoint
https://www.main.bwatmesaj.com/api/v3/sms/{uid}
Parameter | Required | Type | Description |
---|---|---|---|
uid | Yes | string | A unique random uid which is created on the Bwatmesaj platform and is returned upon creation of the object. |
curl -X GET https://main.bwatmesaj.com/api/v3/sms/606812e63f78b \
-H 'Authorization: Bearer 13|4j99SlsIaRf5Zh2X5QIFAFRREuPCMqBYsSBGFnbP5fbfe1ca' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
Returns a contact object if the request was successful.
{
"status": "success",
"data": "sms data with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
API Endpoint
https://www.main.bwatmesaj.com/api/v3/sms/
curl -X GET https://main.bwatmesaj.com/api/v3/sms \
-H 'Authorization: Bearer 13|4j99SlsIaRf5Zh2X5QIFAFRREuPCMqBYsSBGFnbP5fbfe1ca' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
Returns a contact object if the request was successful.
{
"status": "success",
"data": "sms reports with pagination",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
Contacts API
Bwatmesaj Contacts API helps you manage contacts that are identified by a unique random ID. Using this ID, you can create, view, update, or delete contacts. This API works as a collection of customer-specific contacts that allows you to group them and assign custom values that you can later use when sending SMS template messages.
The Contacts API uses HTTP verbs and a RESTful endpoint structure with an access key that is used as the API Authorization. Request and response payloads are formatted as JSON using UTF-8 encoding and URL encoded values.
API Endpoint
https://main.bwatmesaj.com/api/v3/contacts
Parameter | Required | Description |
---|---|---|
Authorization | Yes | When calling our API, send your api token with the authentication type set as Bearer (Example: Authorization: Bearer {api_token} ) |
Accept | Yes | Set to application/json |
Creates a new contact object. Bwatmesaj returns the created contact object with each request.
API Endpoint
https://www.main.bwatmesaj.com/api/v3/contacts/{group_id}/store
Parameter | Required | Type | Description |
---|---|---|---|
group_id | Yes | string | Contact Groups uid |
PHONE | Yes | number | The phone number of the contact. |
OTHER_FIELDS | No | string | All Contact’s other fields: FIRST_NAME (?), LAST_NAME (?),… (depending on the contact group fields configuration) |
curl -X POST https://main.bwatmesaj.com/api/v3/contacts/6065ecdc9184a/store \
-H 'Authorization: Bearer 13|4j99SlsIaRf5Zh2X5QIFAFRREuPCMqBYsSBGFnbP5fbfe1ca' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"PHONE":"8801721970168",
"FIRST_NAME":"Jhon",
"LAST_NAME":"Doe",
}'
Returns a contact object if the request was successful.
{
"status": "success",
"data": "contacts data with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
Retrieves the information of an existing contact. You only need to supply the unique contact uid and group uid that was returned upon creation or receiving.
API Endpoint
https://www.main.bwatmesaj.com/api/v3/contacts/{group_id}/search/{uid}
Parameter | Required | Type | Description |
---|---|---|---|
group_id | Yes | string | Contact Groups uid |
uid | Yes | string | Contact uid |
curl -X POST https://main.bwatmesaj.com/api/v3/contacts/6065ecdc9184a/search/606732aec8705 \
-H 'Authorization: Bearer 13|4j99SlsIaRf5Zh2X5QIFAFRREuPCMqBYsSBGFnbP5fbfe1ca' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
Returns a contact object if the request was successful.
{
"status": "success",
"data": "contacts data with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
Updates an existing contact. You only need to supply the unique uid of contact and contact group uid that was returned upon creation.
API Endpoint
https://www.main.bwatmesaj.com/api/v3/contacts/{group_id}/update/{uid}
Parameter | Required | Type | Description |
---|---|---|---|
group_id | Yes | string | Contact Groups uid |
uid | Yes | string | Contact uid |
PHONE | Yes | number | The phone number of the contact. |
OTHER_FIELDS | No | string | All Contact’s other fields: FIRST_NAME (?), LAST_NAME (?),… (depending on the contact group fields configuration) |
curl -X PATCH https://main.bwatmesaj.com/api/v3/contacts/6065ecdc9184a/update/606732aec8705 \
-H 'Authorization: Bearer 13|4j99SlsIaRf5Zh2X5QIFAFRREuPCMqBYsSBGFnbP5fbfe1ca' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"PHONE":"8801721970168",
"FIRST_NAME":"Jhon",
"LAST_NAME":"Doe",
}'
Returns a contact object if the request was successful.
{
"status": "success",
"data": "contacts data with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
Deletes an existing contact. You only need to supply the unique contact uid and group uid that was returned upon creation.
API Endpoint
https://www.main.bwatmesaj.com/api/v3/contacts/{group_id}/delete/{uid}
Parameter | Required | Type | Description |
---|---|---|---|
group_id | Yes | string | Contact Groups uid |
uid | Yes | string | Contact uid |
curl -X DELETE https://main.bwatmesaj.com/api/v3/contacts/6065ecdc9184a/delete/606732aec8705 \
-H 'Authorization: Bearer 13|4j99SlsIaRf5Zh2X5QIFAFRREuPCMqBYsSBGFnbP5fbfe1ca' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
Returns a contact object if the request was successful.
{
"status": "success",
"data": "contacts data with all details",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}
API Endpoint
https://www.main.bwatmesaj.com/api/v3/contacts/{group_id}/all
Parameter | Required | Type | Description |
---|---|---|---|
group_id | Yes | string | Contact Groups uid |
curl -X POST https://main.bwatmesaj.com/api/v3/contacts/6065ecdc9184a/all \
-H 'Authorization: Bearer 13|4j99SlsIaRf5Zh2X5QIFAFRREuPCMqBYsSBGFnbP5fbfe1ca' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
Returns a contact object if the request was successful.
{
"status": "success",
"data": "contacts data with pagination",
}
If the request failed, an error object will be returned.
{
"status": "error",
"message" : "A human-readable description of the error."
}