MESSAGES
This set of endpoints allows you send messages, campaigns, statistics and status.
SEND MESSAGES
This endpoint allows you to curate and send messages.
This API create and send Messages
Parameters
Body
is_campaign*
Boolean
Set true if message is a campaign
reference*
String
Optional reference but necessary to group campaign
use_bucket*
Boolean
Set true if using bucket
recipients*
Integer
If use bucket is true, use bucket ID else use recipient nunmber
use_template*
Boolean
Set true if template is to be used
body*
String
if use_template is true, use template ID else use message in text box
sender*
String
Optional. You can get it from route/:client_ID
Sample Request
{
"is_campaign": true,
"reference": "abc_123",
"use_bucket": true,
"recipients": "1",
"use_template": true,
"body": "1",
"sender": "GTBank"
}
GET ALL CAMPAIGNS
This endpoint allows you to retrieve all campaigns
This API retrieves all Campaigns
Responses
{
"status": "SUCCESS",
"message": "campaigns retrieved successfully",
"data": {
"items": [
{
"id": 1,
"name": "abc_123",
"client_id": 1,
"template_id": 1,
"bucket_id": 1,
"total": 2,
"created_at": "2024-02-29T11:27:13.000Z",
"created_by": null
}
],
"total": 1
}
}
GET ALL CAMPAIGN STATISTICS
This endpoint allows you retrieve the campaign messages themselves.
This API retrieves campaign messages
Responses
{
"status": "SUCCESS",
"message": "campaign messages retrieved successfully",
"data": {
"items": [],
"total": [
{
"total": "0"
}
]
}
}
GET MESSAGES BY PHONE NUMBER
This endpoint allows you to retrieve messages using a phone number.
This API retrieves messages by phone number
Responses
{
"status": "SUCCESS",
"message": "phone messages retrieved successfully",
"data": {
"items": [],
"total": [
{
"total": "0"
}
]
}
}
GET HOURLY STATISTICS
This endpoint allows you to get statistics by the hour of sent campaigns.
This API retrieves statistics using hour of sent campaign
Responses
{
"status": "SUCCESS",
"message": "hourly statistics retrieved successfully",
"data": {
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0,
"avg_queue_time": 0,
"avg_delivery_time": 0,
"oldest_on_queue": null,
"queue_count": null,
"detail": [
{
"hour": "00:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "01:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "02:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "03:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "04:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "05:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "06:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "07:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "08:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "09:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "10:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "11:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "12:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "13:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "14:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "15:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "16:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "17:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "18:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "19:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "20:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "21:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "22:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
},
{
"hour": "23:00",
"submitted_count": 0,
"sent_count": 0,
"invalid_count": 0,
"successful_count": 0,
"failed_count": 0,
"absent_count": 0
}
]
}
}