Appearance
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.
| Property | Value |
|---|---|
| Endpoint | Fetch All SMS Templates |
| Method | GET |
| URL | /api/v1/sms-templates |
| Authentication | Bearer Token |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer your-auth-token | Yes |
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.
| Property | Value |
|---|---|
| Endpoint | Fetch SMS Template |
| Method | GET |
| URL | /api/v1/sms-templates/{id} |
| Authentication | Bearer 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.
| Property | Value |
|---|---|
| Endpoint | Create SMS Template |
| Method | POST |
| URL | /api/v1/sms-templates |
| Authentication | Bearer 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."
}| Parameter | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Template name |
content | string | Yes | Template 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.
| Property | Value |
|---|---|
| Endpoint | Update SMS Template |
| Method | PUT |
| URL | /api/v1/sms-templates/{id} |
| Authentication | Bearer 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.
| Property | Value |
|---|---|
| Endpoint | Delete SMS Template |
| Method | DELETE |
| URL | /api/v1/sms-templates/{id} |
| Authentication | Bearer Token |
Success Response (200 OK):
json
{
"success": true,
"message": "SMS template deleted successfully"
}