Appearance
User - Tickets
Base URL:
https://your-domain.com
Admin endpoints for managing support tickets. All endpoints require admin/staff authentication.
Fetch All Tickets
Retrieve all support tickets with optional filters.
| Property | Value |
|---|---|
| Endpoint | Fetch All Tickets |
| Method | GET |
| URL | /api/v1/tickets |
| Authentication | Bearer Token |
Request Headers:
| Header | Value | Required |
|---|---|---|
Accept | application/json | Yes |
Authorization | Bearer your-auth-token | Yes |
Query Parameters:
| Parameter | Type | Required | Description |
|---|---|---|---|
isp_id | integer | Yes | ISP ID |
branch_id | integer | Yes | Branch ID |
user_id | integer | Yes | User ID |
status | integer | No | Filter by status (0=Open, 1=In Progress, 2=Resolved, 3=Closed) |
priority | integer | No | Filter by priority (1=Low, 2=Medium, 3=High) |
Success Response (200 OK):
json
{
"success": true,
"data": [
{
"id": 1,
"title": "Connection Issue",
"subscriber_id": 1,
"subscriber_name": "John Doe",
"priority": 2,
"status": 0,
"created_at": "2024-01-15 10:30:00"
}
]
}Fetch Ticket
Retrieve details of a specific ticket including replies.
| Property | Value |
|---|---|
| Endpoint | Fetch Ticket |
| Method | GET |
| URL | /api/v1/tickets/{id} |
| Authentication | Bearer Token |
Success Response (200 OK):
json
{
"success": true,
"data": {
"id": 1,
"title": "Connection Issue",
"description": "Cannot connect to internet",
"subscriber_id": 1,
"subscriber_name": "John Doe",
"priority": 2,
"status": 0,
"replies": [
{
"id": 1,
"message": "We are looking into this.",
"user_name": "Admin",
"created_at": "2024-01-15 11:00:00"
}
],
"created_at": "2024-01-15 10:30:00"
}
}Create Ticket
Create a new support ticket.
| Property | Value |
|---|---|
| Endpoint | Create Ticket |
| Method | POST |
| URL | /api/v1/tickets |
| Authentication | Bearer Token |
Request Body:
json
{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"subscriber_id": 1,
"title": "Connection Issue",
"description": "Cannot connect to internet",
"priority": 2
}| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Ticket title |
description | string | Yes | Issue description |
subscriber_id | integer | No | Related subscriber |
priority | integer | Yes | 1=Low, 2=Medium, 3=High |
Success Response (201 Created):
json
{
"success": true,
"message": "Ticket created successfully",
"data": {
"id": 1
}
}Update Ticket
Update ticket details.
| Property | Value |
|---|---|
| Endpoint | Update Ticket |
| Method | PUT |
| URL | /api/v1/tickets/{id} |
| Authentication | Bearer Token |
Request Body:
json
{
"title": "Updated Title",
"priority": 3
}Success Response (200 OK):
json
{
"success": true,
"message": "Ticket updated successfully"
}Delete Ticket
Delete a support ticket.
| Property | Value |
|---|---|
| Endpoint | Delete Ticket |
| Method | DELETE |
| URL | /api/v1/tickets/{id} |
| Authentication | Bearer Token |
Success Response (200 OK):
json
{
"success": true,
"message": "Ticket deleted successfully"
}Reply to Ticket
Add a reply to a ticket.
| Property | Value |
|---|---|
| Endpoint | Reply to Ticket |
| Method | POST |
| URL | /api/v1/tickets/{id}/reply |
| Authentication | Bearer Token |
Request Body:
json
{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"message": "We are looking into this issue."
}Success Response (201 Created):
json
{
"success": true,
"message": "Reply added successfully"
}Change Ticket Status
Update the status of a ticket.
| Property | Value |
|---|---|
| Endpoint | Change Ticket Status |
| Method | PUT |
| URL | /api/v1/tickets/{id}/status |
| Authentication | Bearer Token |
Request Body:
json
{
"isp_id": 1,
"branch_id": 1,
"user_id": 1,
"status": 2
}| Parameter | Type | Required | Description |
|---|---|---|---|
status | integer | Yes | 0=Open, 1=In Progress, 2=Resolved, 3=Closed |
Success Response (200 OK):
json
{
"success": true,
"message": "Ticket status updated successfully"
}