Appearance
Tickets API ​
Base URL:
https://your-domain.com
Endpoints for managing support tickets and their replies.
All requests require HTTP Basic Authentication.
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/ticket/ticket | Fetch tickets (with filters) |
| POST | /api/ticket/ticket | Create or update a ticket |
| DELETE | /api/ticket/ticket/{id} | Delete a ticket |
| POST | /api/ticket/status | Update a ticket's status |
| POST | /api/ticket/reply | Add a reply/comment to a ticket |
User Type
Many ticket fields use a user_type value: 1 = admin / reseller / staff, 2 = subscriber (user).
Fetch Tickets ​
Retrieve a list of tickets. Without filters, all tickets are returned.
| Property | Value |
|---|---|
| Endpoint | Fetch Tickets |
| Method | GET |
| URL | /api/ticket/ticket |
| Authentication | Basic Auth |
Query Parameters (all optional):
| Parameter | Type | Description |
|---|---|---|
ticket_id | integer | Filter by ticket ID |
user_id | integer | Filter by subscriber ID |
admin_id | integer | Filter by admin ID |
status | integer | Filter by ticket status |
assign_to | integer | Filter by assignee (admin) |
user_type | integer | Filter by user type (1 staff, 2 user) |
title | string | Filter by title |
ticket_date | string | Filter by ticket date |
is_open | integer | Filter by open flag |
opened_time | string | Filter by opened time |
priority | integer | Filter by priority |
ticket_category | integer | Filter by category |
Success Response (200 OK):
Returns a JSON array of ticket objects:
json
[
{
"ticket_id": "58",
"user_id": "1024",
"admin_id": "2",
"status": "1",
"assign_to": "4",
"user_type": "1",
"title": "No internet since morning",
"description": "Customer reports full outage.",
"ticket_date": "2026-07-01 09:15:00",
"is_open": "1",
"opened_time": "2026-07-01 09:20:00",
"opened_ip": "203.0.113.10",
"priority": "2",
"ticket_category": "3",
"note": ""
}
]cURL Example:
bash
curl -X GET "https://your-domain.com/api/ticket/ticket?status=1&priority=2" \
-u "your_api_username:your_api_password" \
-H "Accept: application/json"Create or Update a Ticket ​
A single POST endpoint handles both creating and updating, selected by the post_type field.
| Property | Value |
|---|---|
| Endpoint | Create / Update Ticket |
| Method | POST |
| URL | /api/ticket/ticket |
| Authentication | Basic Auth |
Control Field:
| Parameter | Type | Required | Description |
|---|---|---|---|
post_type | integer | Yes | 1 = create, 2 = update |
post_type = 1 — Create ​
| Parameter | Type | Required | Description |
|---|---|---|---|
title | string | Yes | Ticket title |
user_id | integer | Yes | Subscriber the ticket belongs to |
admin_id | integer | Yes | Admin creating the ticket |
user_type | integer | Yes | 1 staff, 2 user |
priority | integer | Yes | Ticket priority |
status | integer | Yes | Ticket status |
ticket_category | integer | Yes | Ticket category |
description | string | Yes | Ticket description |
assign_to | integer | Yes if user_type = 1 | Admin the ticket is assigned to |
Notifications
When a ticket is created with user_type = 1 and SMS alerts are enabled, Zal Pro automatically sends notification SMS to the subscriber and the assigned admin.
Success Response (200 OK):
json
{
"success": "Ticket Successfully Created."
}post_type = 2 — Update ​
Updates the ticket identified by ticket_id.
| Parameter | Type | Required | Description |
|---|---|---|---|
ticket_id | integer | Yes | Ticket to update |
title | string | Yes | Ticket title |
user_type | integer | Yes | 1 staff, 2 user |
priority | integer | Yes | Ticket priority |
status | integer | Yes | Ticket status |
ticket_category | integer | Yes | Ticket category |
description | string | Yes | Ticket description |
user_id | integer | Yes if user_type = 1 | Subscriber the ticket belongs to |
assign_to | integer | Yes if user_type = 1 | Assignee (admin) |
Success Response (200 OK):
json
{
"success": "Ticket Successfully Updated."
}cURL Example (create):
bash
curl -X POST "https://your-domain.com/api/ticket/ticket" \
-u "your_api_username:your_api_password" \
-H "Accept: application/json" \
-d "post_type=1" \
-d "title=No internet since morning" \
-d "user_id=1024" \
-d "admin_id=2" \
-d "user_type=1" \
-d "assign_to=4" \
-d "priority=2" \
-d "status=1" \
-d "ticket_category=3" \
-d "description=Customer reports full outage."Delete a Ticket ​
| Property | Value |
|---|---|
| Endpoint | Delete Ticket |
| Method | DELETE |
| URL | /api/ticket/ticket/{id} |
| Authentication | Basic Auth |
Path Parameter:
| Parameter | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | ID of the ticket to delete |
Success Response (200 OK):
json
{
"success": "Ticket Successfully Deleted."
}Error Response (200):
json
{
"error": "Oops! Failed To Delete Ticket."
}cURL Example:
bash
curl -X DELETE "https://your-domain.com/api/ticket/ticket/58" \
-u "your_api_username:your_api_password" \
-H "Accept: application/json"Update Ticket Status ​
Change only the status of a ticket.
| Property | Value |
|---|---|
| Endpoint | Update Ticket Status |
| Method | POST |
| URL | /api/ticket/status |
| Authentication | Basic Auth |
Fields:
| Parameter | Type | Required | Description |
|---|---|---|---|
ticket_id | integer | Yes | Ticket to update |
status | integer | Yes | New status value |
Success Response (200 OK):
json
{
"success": "Ticket Status Successfully Updated."
}cURL Example:
bash
curl -X POST "https://your-domain.com/api/ticket/status" \
-u "your_api_username:your_api_password" \
-H "Accept: application/json" \
-d "ticket_id=58" \
-d "status=3"Reply to a Ticket ​
Add a comment/reply to an existing ticket.
| Property | Value |
|---|---|
| Endpoint | Ticket Reply |
| Method | POST |
| URL | /api/ticket/reply |
| Authentication | Basic Auth |
Fields:
| Parameter | Type | Required | Description |
|---|---|---|---|
ticket_id | integer | Yes | Ticket to reply to |
user_type | integer | Yes | 1 staff, 2 user |
user_id | integer | Yes | ID of the author of the reply |
comment | string | Yes | Reply text |
Success Response (200 OK):
json
{
"success": "Comment Successfully Replied."
}Error Response (200):
json
{
"error": "Oops! Ticket Not Found."
}cURL Example:
bash
curl -X POST "https://your-domain.com/api/ticket/reply" \
-u "your_api_username:your_api_password" \
-H "Accept: application/json" \
-d "ticket_id=58" \
-d "user_type=1" \
-d "user_id=2" \
-d "comment=We have dispatched a technician."