Skip to content

User - SMS Templates

Base URL: https://your-domain.com

Admin endpoints for managing SMS templates. All endpoints require admin/staff authentication.


Fetch All SMS Templates

Retrieve all SMS templates.

PropertyValue
EndpointFetch All SMS Templates
MethodGET
URL/api/v1/sms-templates
AuthenticationBearer Token

Request Headers:

HeaderValueRequired
Acceptapplication/jsonYes
AuthorizationBearer your-auth-tokenYes

Success Response (200 OK):

json
{
    "success": true,
    "data": [
        {
            "id": 1,
            "name": "Payment Reminder",
            "content": "Dear {name}, your payment of {amount} is due.",
            "is_active": true
        }
    ]
}

Fetch SMS Template

Retrieve details of a specific SMS template.

PropertyValue
EndpointFetch SMS Template
MethodGET
URL/api/v1/sms-templates/{id}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "data": {
        "id": 1,
        "name": "Payment Reminder",
        "content": "Dear {name}, your payment of {amount} is due.",
        "variables": ["{name}", "{amount}", "{due_date}"]
    }
}

Create SMS Template

Create a new SMS template.

PropertyValue
EndpointCreate SMS Template
MethodPOST
URL/api/v1/sms-templates
AuthenticationBearer Token

Request Body:

json
{
    "isp_id": 1,
    "branch_id": 1,
    "user_id": 1,
    "name": "Payment Reminder",
    "content": "Dear {name}, your payment of {amount} is due."
}
ParameterTypeRequiredDescription
namestringYesTemplate name
contentstringYesTemplate content with variables

Success Response (201 Created):

json
{
    "success": true,
    "message": "SMS template created successfully",
    "data": {
        "id": 1
    }
}

Update SMS Template

Update an existing SMS template.

PropertyValue
EndpointUpdate SMS Template
MethodPUT
URL/api/v1/sms-templates/{id}
AuthenticationBearer Token

Request Body:

json
{
    "content": "Updated content with {variables}"
}

Success Response (200 OK):

json
{
    "success": true,
    "message": "SMS template updated successfully"
}

Delete SMS Template

Delete an SMS template.

PropertyValue
EndpointDelete SMS Template
MethodDELETE
URL/api/v1/sms-templates/{id}
AuthenticationBearer Token

Success Response (200 OK):

json
{
    "success": true,
    "message": "SMS template deleted successfully"
}

www.onezeroart.com