Skip to main content

Query Messages

Endpoint

GET  /sms/messages

Description

The /sms/messages endpoint provides a paginated query of all messages sent. The filters below are available to the endpoint

Query Parameters (optional)

ParameterTypeDescription
pageNumberThe page number to retrieve.
per_pageNumberThe number of results per page.
queryStringA search term to filter messages by content.
sender_idNumberThe Sender ID of the message sent Refer here.
categoryStringThe category of the message: authentication, utility, marketing.
statusNumberThe status of the message Refer here.
date_createdStringThe time period to filter messages by. Use one of the following options: today, yesterday, this-week, this-month, or custom.
start_dateStringRequired when date_created is set to custom. The start date for filtering messages.
end_dateStringRequired when date_created is set to custom. The end date for filtering messages.

Example Request

curl -X GET "https://service-prod.api.comms360.africa/api/sms/messages?category=authentication&date_created=custom&end_date=2025-01-13&page=1&per_page=10&sender_id=29&start_date=2025-01-13"

Example Response

HTTP/1.1 200 OK
Content-Type: application/json

{
"responsecode": 200,
"data": {
"data": {
"id": 0,
"sender_id": "MySenderID",
"category": "authentication",
"campaign": "campaign_tag",
"message": "Here is a test message",
"schedule": "2025-01-01T00:00:00.000000Z",
"creator": "John doe",
"status": "Pending",
"sms_recipients": [
{
"phone_number": "+23320000000",
"reference": null,
"status": "Pending",
"created_at": "2025-01-01T00:00:00.000000Z"
}
],
"sms_list_recipients": [],
"created_at": "2025-01-01T00:00:00.000000Z"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"per_page": 10,
"to": 1,
"total": 1
}
},
"responsemessage": "Contact lists retrieved"
}