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)
| Parameter | Type | Description |
|---|---|---|
page | Number | The page number to retrieve. |
per_page | Number | The number of results per page. |
query | String | A search term to filter messages by content. |
sender_id | Number | The Sender ID of the message sent Refer here. |
category | String | The category of the message: authentication, utility, marketing. |
status | Number | The status of the message Refer here. |
date_created | String | The time period to filter messages by. Use one of the following options: today, yesterday, this-week, this-month, or custom. |
start_date | String | Required when date_created is set to custom. The start date for filtering messages. |
end_date | String | Required 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"
}