Introduction
This API offers services for managing and sending SMS messages, including handling message templates, clients, files, and
subscriptions. It adheres to RESTful principles, supporting Create, Read, Update, and Delete (CRUD) operations. This document
details the available API endpoints, their usage, and provides sample requests and responses.
SMS Developer Module
Base URL
Headers
All requests must include the following headers:
json
- {
- “Authorization”: Bearer YOUR_API_TOKEN,
- "Content-Type": "application/json"
- }
You can got the Bearer YOUR_API_TOKEN from API module
Sender ID
To get the sender ID
Send Quick Message
Send a quick message to one or more phone numbers.
Parameters
Notes:
- If the user provides a templateMessageId, they should leave the content field empty. Conversely, if the user fills in the content, they can leave the templateMessageId empty.
- Ensure that the fields senderId, jobName, isScheduled, scheduledTime, and phoneNumbers are always filled in as they are marked with asterisks, indicating that they are mandatory.
- PhoneNumbers must be in this format "966558883879".
- Date and time is separated with a capital T.
- UTC time is defined with a capital letter Z.
Body
- {
- "senderId": "UUID of the sender",
- "jobName": "Job name or description",
- "isScheduled": false,
- "scheduledTime": "",
- "content": ["Message content"],
- "phoneNumbers": ["RecipientPhoneNumber"],
- "templateMessageId": "UUID of the template message"
- }
Response
SUCCESS
- {
- "success": true,
- "message": "Success",
- "data": {
- "message": "Message sent to queue, the status will be provided after a while"
- }
- }
Error Handling
If there is an error, such as Missing Key
FAILURE
- {
- "statusCode": 400,
- "message": {
- "message": [
- "each value in phoneNumbers must match /^9665[0-9]{8}$/ regular
- expression",
- "senderId must be a UUID",
- "senderId should not be empty",
- "jobName must be a string"
- ],
- "error": "Bad Request",
- "statusCode": 400
- },
- "success": false
- }
If there is an error, such as Has Not Subscribed
FAILURE
- {
- "statusCode": 404,
- "message": {
- "message": "Not Subscribed",
- "error": "Not Found",
- "statusCode": 404
- },
- "success": false
- }
Create OTP
Create and send an OTP message to a phone number.
Parameters
Notes:
- If the user provides a templateMessageId, they should leave the content field empty. Conversely, if the user fills in
the content, they can leave the templateMessageId empty.
- Ensure that the fields senderId, jobName, isScheduled, scheduledTime, and phoneNumbers are always filled
in as they are marked with asterisks, indicating that they are mandatory.
- PhoneNumbers must be in this format "966558883879".
- Date and time is separated with a capital T.
- UTC time is defined with a capital letter Z.
Body
- {
- "senderId": "UUID of the sender",
- "jobName": "Job name or description",
- "isScheduled": false,
- "scheduledTime": "",
- "content": ["OTP message content"],
- "phoneNumbers": ["RecipientPhoneNumber"],
- "templateMessageId": "UUID of the template message"
- }
Response
SUCCESS
- {
- "success": true,
- "message": "Success",
- "data": {
- "message": "Message sent to queue, the status will be provided after a
while"
} - }
Error Handling
If there is an error, such as Missing Key
FAILURE
- {
- "statusCode": 400,
"message": - {
"message": [
- "each value in phoneNumbers must match /^9665[0-9]{8}$/ regular
expression",
- "senderId must be a UUID",
- "senderId should not be empty",
- "jobName must be a string"
- ],
- "error": "Bad Request",
- "statusCode": 400
- },
- "success": false
- }
If there is an error, such as Has Not Subscribed
FAILURE
- {
- "statusCode": 404,
- "message": {
- "message": "Not Subscribed",
- "error": "Not Found",
- "statusCode": 404
- },
- "success": false
- }
Resend OTP
Resend an OTP message to a phone number.
Parameters
Notes:
- If the user provides a templateMessageId, they should leave the content field empty. Conversely, if the user fills in
the content, they can leave the templateMessageId empty.
- Ensure that the fields senderId, jobName, isScheduled, scheduledTime, and phoneNumbers are always filled
in as they are marked with asterisks, indicating that they are mandatory.
- PhoneNumbers must be in this format "966558883879".
- Date and time is separated with a capital T.
- UTC time is defined with a capital letter Z.
Body
- {
- "senderId": "UUID of the sender",
- "jobName": "Job name or description",
- "isScheduled": false,
- "scheduledTime": "",
"content": ["OTP message content"],
- "phoneNumbers": ["RecipientPhoneNumber"],
- "templateMessageId":"UUID of the template message"
- }
- {
"success": true,
- "message": "Success",
- "data": {
- "message": "OTP ReSent successfully"
- }
- }
Error Handling
If there is an error, such as Resend OTP
FAILURE
- {
- "statusCode": 400,
- "message": {
- "message": [
- "each value in phoneNumbers must match /^9665[0-9]{8}$/ regular
expression",
- "senderId must be a UUID",
- "senderId should not be empty",
- "jobName must be a string"
- ],
- "error": "Bad Request",
- "statusCode": 400
- },
- "success": false
- }
If there is an error, such as Invalid Sender ID
FAILURE
- {
- "statusCode": 422,
- "message": {
- "message": "Client with the given ID does not exist",
- "error": "Unprocessable Entity",
- "statusCode": 422
- },
- "success": false
- }
Verify OTP
Verify an OTP sent to a phone number.
Parameters
PhoneNumbers* | number | Recipient Phone Number
|
Body
- {
- "phoneNumber": "RecipientPhoneNumber",
- "otp": "123456"
- }
Response
SUCCESS
- {
- "success": true,
- "message": "OTP verified successfull
- }
Error Handling
If there is an error, such as PhoneNumber Problem
FAILURE
- {
- "statusCode": 400,
- "message": {
- "message": [
- "phoneNumber must match /^9665[0-9]{8}$/ regular expression"
- ],
- "error": "Bad Request",
- "statusCode": 400
- },
- "success": false
- }
If there is an error, such as Not Found
FAILURE
- {
- "statusCode": 404,
- "message": {
- "message": "Message not found",
- "error": "Not Found",
- "statusCode": 404
},
"success": false
}
Create Bulk SMS
Send bulk SMS to multiple phone numbers.
Parameters
senderId * | string | The ID of the sender that you got from the Pervious step |
jobName * | number | The name of the campaign. |
isScheduled* | string | Indicates whether the message is scheduled (yes/no). This field can contain values like 'true' or 'false'. |
scheduledTime * | string | The time when the message should be sent if it's scheduled. Format it as a"2015- 03-25T12:00:00Z" |
content | string | The body of the message to be sent. This field is optional if templateMessageId is provided. |
Attachment* | File | CSV File with the Contact |
templateMessageId | string | The ID of the template message if using predefined templates. If provided, content can be left empty.
|
Notes:
- If the user provides a templateMessageId, they should leave the content field empty. Conversely, if the user fills in the content, they can leave the templateMessageId empty.
- Ensure that the fields senderId, jobName, isScheduled, scheduledTime, and phoneNumbers are always filled in as they are marked with asterisks, indicating that they are mandatory.
- Date and time is separated with a capital T.
- UTC time is defined with a capital letter Z.
Body
- {
- "senderId": "UUID of the sender",
- "jobName": "Job name or description",
- "isScheduled": false,
- "scheduledTime": "",
- "content": [""],
- "attachment": "Sample File.csv"
- }
- {
- "success": true,
- "message": "Success"
- }
Error Handling
If there is an error, such as No File
FAILURE
- {
- "statusCode": 422,
- "message": {
- "message": "You must upload one file
- "error": "Unprocessable Entity",
- "statusCode": 422
- },
- "success": false
- }
If there is an error, such as Invalid Sender
FAILURE
- {
- "statusCode": 422,
- "message": {
- "message": "Client with the given ID does not exist",
- "error": "Unprocessable Entity",
- "statusCode": 422
- },
- "success": false
- }
Get All Messages
Send bulk SMS to multiple phone numbers
Parameters
page * | Integer | The page number of the results to retrieve. Used for pagination. |
limit * | Integer | The number of results per page. Controls the size of each paginated result set. |
Response
Get All
SUCCESS
- {
- "success": true,
- "message": "Success",
- "data": [
- {
- "id": "89c4b2f8-b503-4592-8213-00127552b501",
- "jobId": "66814898-1036-4710-8e74-19515fc0a037",
- "workspaceId": "d51fd261-9c0a-4406-a408-41ec053af797",
- "senderId": "e5e5d04d-01f2-4cf0-9250-ab272693ab7b",
- "senderIdName": "Bevatel5",
- "otp": null,
- "phoneNumber": "966558883879",
- "content": "TEST",
- "status": 0,
- "sentAt": null,
- "createdAt": "2024-09-25T11:20:42.822Z",
- "updatedAt": "2024-09-25T11:20:42.822Z",
- "deletedAt": null,
- "batchId": null,
- "otpSendingDate": "2024-09-25T11:12:53.740Z",
- "otpStatus": 0
- },
- {
- "id": "ca23eb8b-51cd-4943-8855-f613f52e3d30",
- "jobId": "f0a38285-ff66-440b-a181-c02f981c51d8",
- "workspaceId": "d51fd261-9c0a-4406-a408-41ec053af797",
- "senderId": "e5e5d04d-01f2-4cf0-9250-ab272693ab7b",
- "senderIdName": "Bevatel5",
- "otp": null,
- "phoneNumber": "966558883879",
- "content": "TEST",
- "status": 0,
- "sentAt": null,
- "createdAt": "2024-09-25T11:24:05.237Z",
- "updatedAt": "2024-09-25T11:24:05.237Z",
- "deletedAt": null,
- "batchId": null,
- "otpSendingDate": "2024-09-25T11:12:53.740Z",
- "otpStatus": 0
- }
- ],
- "meta": {
- "current_page": 1,
- "from": 1,
- "last_page": 1,
- "per_page": 10,
- "to": 2,
- "total": 2
- }
- }
Response
PAGE AND LIMIT
SUCCESS
- {
- "success": true,
- "message": "Success",
- "data": [
- {
- "id": "89c4b2f8-b503-4592-8213-00127552b501",
- "jobId": "66814898-1036-4710-8e74-19515fc0a037",
- "workspaceId": "d51fd261-9c0a-4406-a408-41ec053af797",
- "senderId": "e5e5d04d-01f2-4cf0-9250-ab272693ab7b",
- "senderIdName": "Bevatel5",
- "otp": null,
- "status": 0,
- "phoneNumber": "966558883879",
- "content": "TEST",
- "status": 0,
- "sentAt": null,
- "createdAt": "2024-09-25T11:20:42.822Z",
- "updatedAt": "2024-09-25T11:20:42.822Z",
- "deletedAt": null,
- "batchId": null,
- "otpSendingDate": "2024-09-25T11:12:53.740Z",
- "otpStatus": 0
- },
- {
- "id": "a989d19e-2507-442a-848b-51debb4f1fef",
- "jobId": "92b0a1fa-16c5-46c8-95f8-20d8cc2a55c2",
- "workspaceId": "d51fd261-9c0a-4406-a408-41ec053af797",
- "senderId": "e5e5d04d-01f2-4cf0-9250-ab272693ab7b",
- "senderIdName": "Bevatel5",
- "otp": null,
- "phoneNumber": "+966 12 398 7654",
- "content": "TEST",
- "status": 0,
- "sentAt": null,
- "createdAt": "2024-09-25T11:28:06.488Z",
- "updatedAt": "2024-09-25T11:28:06.488Z",
- "deletedAt": null,
- "batchId": null,
- "otpSendingDate": "2024-09-25T11:12:53.740Z",
- "otpStatus": 0
- }
- ],
- "meta": {
- "current_page": 1,
- "from": 1,
- "last_page": 1,
- "per_page": 25,
- "to": 2,
- "total": 2
- }
- }
Get Message by ID
Send bulk SMS to multiple phone numbers

GET https://bevatel-system-api.bevatel.com/sms/developer/v1/{{message-ID}}
Parameters
message-ID * | string | The ID of the message that you got from the Pervious step |
Response
Get One Message
SUCCESS
- {
- "success": true,
- "message": "Success",
- "data": {
"id": "89c4b2f8-b503-4592-8213-00127552b501",
- "jobId": "66814898-1036-4710-8e74-19515fc0a037",
- "workspaceId": "d51fd261-9c0a-4406-a408-41ec053af797",
- "senderId": "e5e5d04d-01f2-4cf0-9250-ab272693ab7b",
- "senderIdName": "Bevatel5",
- "otp": null,
- "phoneNumber": "966558883879",
- "content": "TEST",
- "status": 0,
- "sentAt": null,
- "createdAt": "2024-09-25T11:20:42.822Z",
- "updatedAt": "2024-09-25T11:20:42.822Z",
- "deletedAt": null,
- "batchId": null,
- "otpSendingDate": "2024-09-25T11:12:53.740Z",
- "otpStatus": 0,
- "client": null,
- "template": null
- }
- }
Error Handling
Response
Not Found Message
FAILURE
- {
- "statusCode": 404,
- "message": {
- "message": "Message not found",
- "error": "Not Found",
- "statusCode": 404
- },
- "success": false
- }
Reports
This endpoint retrieves job messages based on the specified filters and pagination settings.
Parameters
type * | string | Based on the type of job (Quick or Bulk). |
page * | integer | The page number to retrieve for pagination. Default is 1. |
limit * | integer | The number of items per page. Example: 3 to retrieve three items per page. |
Authorization * | String | Bearer token obtained from the authentication step. Must be formatted as Bearer {token}. |
Note: The Bearer token is the API token you receive in the first step of the authentication process. Ensure you include this token in the Authorization header for all subsequent requests.
Response
Fetch All Jobs
SUCCESS
- {
- "success": true,
- "message": "Success",
- "data": [
- {
- "name": "sadsadsadsad",
- "senderName": "Bevatel5",
- "id": "66814898-1036-4710-8e74-19515fc0a037",
- "type": "quick",
- "failedCount": 0,
- "pendingCount": 1,
- "sentCount": 0,
- "total": 1,
- "status": "finished",
- "startedAt": "2024-09-25T11:20:42.799Z"
- },
- {
- "name": "sadsadsadsad",
- "senderName": "Bevatel5",
- "id": "f0a38285-ff66-440b-a181-c02f981c51d8
- "type": "quick",
- "failedCount": 0,
- "pendingCount": 1,
- "sentCount": 0,
- "total": 1,
- "status": "finished
- "startedAt": "2024-09-25T11:24:05.218Z"
- },
- {
- "name": "sadsadsadsad",
- "senderName": "Bevatel5",
- "id": "92b0a1fa-16c5-46c8-95f8-20d8cc2a55c2",
- "type": "quick",
- "failedCount": 0,
- "pendingCount": 2,
- "sentCount": 0,
- "total": 2,
- "status": "finished
- "startedAt": "2024-09-25T11:28:06.461Z"
- }
- ],
- "meta": {
- "current_page": 1,
- "from": 1,
- "last_page": 1,
- "per_page": 10,
- "to": 3,
- "total": 3
- }
- }
Delete Job
Parameters
job-ID * | string | The ID of the job that you got from the Pervious step |
Response
Fetch All Jobs
SUCCESS
- {
- "success": true,
- "message": "Success"
- }
Error Handling
Response
Not Found Job
FAILURE
- {
- "statusCode": 404,
- "message": {
- "message": "MessageJob not found",
- "error": "Not Found",
- "statusCode": 404
- },
- "success": false
- }
Cannot Delete A started job
FAILURE
- {
- "statusCode": 400,
- "message": {
- "message": "Cannot delete a job that has already started",
- "error": "Bad Request",
- "statusCode": 400
- },
- "success": false
- }