Skip to content

Tickets API ​

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

Endpoints for managing support tickets and their replies.

All requests require HTTP Basic Authentication.

MethodEndpointDescription
GET/api/ticket/ticketFetch tickets (with filters)
POST/api/ticket/ticketCreate or update a ticket
DELETE/api/ticket/ticket/{id}Delete a ticket
POST/api/ticket/statusUpdate a ticket's status
POST/api/ticket/replyAdd 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.

PropertyValue
EndpointFetch Tickets
MethodGET
URL/api/ticket/ticket
AuthenticationBasic Auth

Query Parameters (all optional):

ParameterTypeDescription
ticket_idintegerFilter by ticket ID
user_idintegerFilter by subscriber ID
admin_idintegerFilter by admin ID
statusintegerFilter by ticket status
assign_tointegerFilter by assignee (admin)
user_typeintegerFilter by user type (1 staff, 2 user)
titlestringFilter by title
ticket_datestringFilter by ticket date
is_openintegerFilter by open flag
opened_timestringFilter by opened time
priorityintegerFilter by priority
ticket_categoryintegerFilter 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.

PropertyValue
EndpointCreate / Update Ticket
MethodPOST
URL/api/ticket/ticket
AuthenticationBasic Auth

Control Field:

ParameterTypeRequiredDescription
post_typeintegerYes1 = create, 2 = update

post_type = 1 — Create ​

ParameterTypeRequiredDescription
titlestringYesTicket title
user_idintegerYesSubscriber the ticket belongs to
admin_idintegerYesAdmin creating the ticket
user_typeintegerYes1 staff, 2 user
priorityintegerYesTicket priority
statusintegerYesTicket status
ticket_categoryintegerYesTicket category
descriptionstringYesTicket description
assign_tointegerYes if user_type = 1Admin 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.

ParameterTypeRequiredDescription
ticket_idintegerYesTicket to update
titlestringYesTicket title
user_typeintegerYes1 staff, 2 user
priorityintegerYesTicket priority
statusintegerYesTicket status
ticket_categoryintegerYesTicket category
descriptionstringYesTicket description
user_idintegerYes if user_type = 1Subscriber the ticket belongs to
assign_tointegerYes if user_type = 1Assignee (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 ​

PropertyValue
EndpointDelete Ticket
MethodDELETE
URL/api/ticket/ticket/{id}
AuthenticationBasic Auth

Path Parameter:

ParameterTypeRequiredDescription
idintegerYesID 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.

PropertyValue
EndpointUpdate Ticket Status
MethodPOST
URL/api/ticket/status
AuthenticationBasic Auth

Fields:

ParameterTypeRequiredDescription
ticket_idintegerYesTicket to update
statusintegerYesNew 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.

PropertyValue
EndpointTicket Reply
MethodPOST
URL/api/ticket/reply
AuthenticationBasic Auth

Fields:

ParameterTypeRequiredDescription
ticket_idintegerYesTicket to reply to
user_typeintegerYes1 staff, 2 user
user_idintegerYesID of the author of the reply
commentstringYesReply 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."

www.onezeroart.com