Skip to main content

TEMPLATE

A Template is a pre defined message format which can be called over and again, without requiring to rewrite again.

CREATE TEMPLATE

This endpoint allows you to create a bucket which contains all the phone numbers to be reached via sms.

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

This API creates SMS Bucket

Parameters

Body

name*

String

Name of Template

Body*

String

Actual template form to be used continuously

Cliet_id*

Integer

Unique client ID pre-assigned

Description*

String

Description of template

Sample Request

{
"name": "CHDP_C",
"body": "Txn: Credit\nAc:#$TXN_ACC$#\nAmt:#$AMOUNT$#\nDes:Cash Dep/_BRC_/#$OFS_ACC$#/#$TRANSACTION_ID$#\nDate:#$TXN_DATE$#\nBal#$CCY$##$AVAIL_BAL$#\n#$sms_advert#",
"client_id": 2,
"description":"CASH DEPOSIT CREDITING"
}

Responses

200:OK
Success
{
"status": "CREATED",
"message": "template created successfully",
"data": {
"id": 5,
"name": "CHDP_C",
"description": "CASH DEPOSIT CREDITING",
"client_id": 2,
"created_at": "2024-04-08T13:02:44.000Z",
"created_by": 1,
"updated_at": null,
"updated_by": null
}
}

GET ALL CREATED TEMPLATE

This endpoint allows you to retrieve all created templates

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

This API retrieves all Template

Responses

200:OK
Success
{
"status": "SUCCESS",
"message": "templates retrieved successfully",
"data": {
"items": [
{
"id": 2,
"name": "FTRQ_D",
"body": "Txn: Debit
Ac:#$TXN_ACC$#
Amt:#$AMOUNT$#
Des:AAC/Debit/Funds Transfer/#$TRANSACTION_ID$#
Date:#$TXN_DATE$#
Bal:#$AVAIL_BAL$#
#$sms_advert$#",
"description": "FUNDS TRANSFER DEBIT",
"client_id": 2,
"params": [
"phone_number",
"TXN_ACC",
"AMOUNT",
"TRANSACTION_ID",
"TXN_DATE",
"AVAIL_BAL",
"sms_advert"
],
"created_at": "2024-03-20T20:28:53.000Z",
"created_by": 10,
"updated_at": "2024-03-26T06:48:22.000Z",
"updated_by": 10
},
{
"id": 3,
"name": "FTRQ_C",
"body": "Credit
Ac:#$OFS_ACC$#
Amt:#$CCY$##$AMOUNT$#
Des:AAC/Credit/Funds Transfer/#$TRANSACTION_ID$#
Date:#$TXN_DATE$#
Bal:#$CCY$##$AVAIL_BAL$#
#$sms_advert$#",
"description": "FUNDS TRANSFER CREDIT",
"client_id": 2,
"params": [
"phone_number",
"OFS_ACC",
"CCY",
"AMOUNT",
"TRANSACTION_ID",
"TXN_DATE",
"CCY",
"AVAIL_BAL",
"sms_advert"
],
"created_at": "2024-03-20T20:31:37.000Z",
"created_by": 10,
"updated_at": "2024-03-26T06:53:23.000Z",
"updated_by": 10
},
{
"id": 4,
"name": "CHDP_C",
"body": "Txn: Credit
Ac:#$TXN_ACC$#
Amt:#$AMOUNT$#
Des:Cash Dep/_BRC_/#$OFS_ACC$#/#$TRANSACTION_ID$#
Date:#$TXN_DATE$#
Bal#$CCY$##$AVAIL_BAL$#
#$sms_advert$#",
"description": "CASH DEPOSIT CREDIT",
"client_id": 2,
"params": [
"phone_number",
"TXN_ACC",
"AMOUNT",
"OFS_ACC",
"TRANSACTION_ID",
"TXN_DATE",
"CCY",
"AVAIL_BAL",
"sms_advert"
],
"created_at": "2024-03-20T20:39:02.000Z",
"created_by": 10,
"updated_at": "2024-03-26T06:53:09.000Z",
"updated_by": 10
},
{
"id": 5,
"name": "CHDP_C",
"body": "Txn: Credit
Ac:#$TXN_ACC$#
Amt:#$AMOUNT$#
Des:Cash Dep/_BRC_/#$OFS_ACC$#/#$TRANSACTION_ID$#
Date:#$TXN_DATE$#
Bal#$CCY$##$AVAIL_BAL$#
#$sms_advert#",
"description": "CASH DEPOSIT CREDITING",
"client_id": 2,
"params": [
"phone_number",
"TXN_ACC",
"AMOUNT",
"OFS_ACC",
"TRANSACTION_ID",
"TXN_DATE",
"CCY",
"AVAIL_BAL"
],
"created_at": "2024-04-08T13:02:44.000Z",
"created_by": 1,
"updated_at": null,
"updated_by": null
}
],
"total": 4
}
}

UPDATE CREATED TEMPLATE

This endpoint allows you to edit the body of a template.

PATCH
https://squadbygtco.com:8080/dashboard/template/3

This API update template

Sample Request

{
"body": "Credit\nAc:#$OFS_ACC$#\nAmt:#$CCY$##$AMOUNT$#\nDes:AAC/Credit/Funds Transfer/#$TRANSACTION_ID$#\nDate:#$TXN_DATE$#\nBal:#$CCY$##$AVAIL_BAL$#\n#$sms_advert$#"
}

Responses

200:OK
Success
{ 
"status": "SUCCESS",
"message": "template updated successfully",
"data": {
"id": 3,
"name": "FTRQ_C",
"description": "FUNDS TRANSFER CREDIT",
"client_id": 2,
"created_at": "2024-03-20T20:31:37.000Z",
"created_by": 10,
"updated_at": "2024-04-08T13:08:32.000Z",
"updated_by": 1
}
}

DELETE CREATED BUCKETS

This endpoint allows you to delete a Template

POST
https://squadbygtco.com:8080/dashboard/bucket/1

This API deletes created Template

Responses

200:OK
Success
{
"message": "success"
}