Skip to main content

MESSAGES

This set of endpoints allows you send messages, campaigns, statistics and status.

SEND MESSAGES

This endpoint allows you to curate and send messages.

POST
https://squadbygtco.com:8080/dashboard/message

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

GET
https://squadbygtco.com:8080/dashboard/template/by-client/2?page=1&count=10

This API retrieves all Campaigns

Responses

200:OK
Success
{
"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.

GET
https://squadbygtco.com:8080/dashboard/message/statistics/by-client/1?page=1&count=10

This API retrieves campaign messages

Responses

200:OK
Success
{
"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.

GET
https://squadbygtco.com:8080/dashboard/message/by-phone/0701234?page=1&count=20

This API retrieves messages by phone number

Responses

200:OK
Success
{
"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.

GET
https://squadbygtco.com:8080/dashboard/message.summary/hourly-statistics/by-client/2?date=2024-03-12

This API retrieves statistics using hour of sent campaign

Responses

200:OK
Success
{
"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
}
]
}
}