The support system provides REST API endpoints for ticket management, categories, agents, and attachments.
Source: includes/api/class-slswc-support-api.php
Tickets
GET /support/tickets
List support tickets. Admins see all tickets; non-admin users see only their own tickets plus tickets on licenses where they are an agent.
Authentication: Logged-in user
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
status | string | No | Filter by status (open, in_progress, waiting, resolved, closed) |
search | string | No | Search by subject or ticket number |
Example Request:
curl https://your-site.com/wp-json/slswc/v1/support/tickets \
-H "X-WP-Nonce: YOUR_NONCE" \
--cookie "wordpress_logged_in_xxx=..."
Success Response (200):
[
{
"id": 1,
"ticket_number": "TIC-000001",
"user_id": 5,
"order_id": null,
"license_id": 42,
"license_key": "ABCD-1234",
"category_id": 2,
"subject": "Installation help needed",
"status": "open",
"priority": "normal",
"assigned_to": null,
"created_at": "2025-03-15 10:00:00",
"updated_at": "2025-03-15 14:30:00",
"category_name": "Technical Support",
"category_color": "#3b82f6"
}
]
POST /support/tickets
Create a new support ticket.
Authentication: Logged-in user, or public if slswc_support_public_enabled is yes
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
subject | string | Yes | Ticket subject |
message | string | Yes | Initial message body |
category_id | int | Yes | Support category ID |
license_id | int | No | Associated license ID |
license_key | string | No | Associated license key |
priority | string | No | low, normal, high, urgent (default: normal) |
is_public | bool | No | Flag for public (guest) submissions |
guest_name | string | No | Guest name (for unauthenticated tickets) |
guest_email | string | No | Guest email (for unauthenticated tickets) |
Example Request:
curl -X POST https://your-site.com/wp-json/slswc/v1/support/tickets \
-H "X-WP-Nonce: YOUR_NONCE" \
--cookie "wordpress_logged_in_xxx=..." \
-H "Content-Type: application/json" \
-d '{
"subject": "Cannot activate license",
"message": "I get an error when trying to activate...",
"category_id": 3,
"license_key": "ABCD-1234-EFGH-5678"
}'
Success Response (201):
{
"id": 15,
"ticket_number": "TIC-000015",
"status": "open"
}
GET /support/tickets/{id}
Get a single ticket with all details.
Authentication: User must have access to the ticket (owner, agent on associated license, or admin)
Example Request:
curl https://your-site.com/wp-json/slswc/v1/support/tickets/15 \
-H "X-WP-Nonce: YOUR_NONCE" \
--cookie "wordpress_logged_in_xxx=..."
POST /support/tickets/{id}
Perform an action on a ticket (reply, change status, assign).
Authentication: User must have access to the ticket
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
action | string | Yes | Action to perform: reply, status, assign, priority |
message | string | Conditional | Required for reply action |
message_id | int | Conditional | Required for reply notification |
new_status | string | Conditional | Required for status action |
agent_id | int | Conditional | Required for assign action |
priority | string | Conditional | Required for priority action |
is_internal | bool | No | Mark reply as internal note (default: false) |
DELETE /support/tickets/{id}
Delete a ticket.
Authentication: manage_options
GET /support/tickets/{id}/messages
Get all messages for a ticket.
Authentication: User must have access to the ticket
POST /support/tickets/{id}/messages
Add a message (reply) to a ticket.
Authentication: User must have access to the ticket
POST /support/tickets/{id}/attachments
Sync attachments for a ticket.
Authentication: User must have access to the ticket
Categories
GET /support/categories
List all support categories.
Authentication: Public (no auth required) โ categories are readable for the support form.
Example Request:
curl https://your-site.com/wp-json/slswc/v1/support/categories
Success Response (200):
[
{
"id": 1,
"name": "General Inquiry",
"slug": "general",
"description": null,
"color": "#3b82f6",
"icon": "help-circle",
"is_active": 1,
"sort_order": 0
},
{
"id": 2,
"name": "Technical Support",
"slug": "technical",
"color": "#3b82f6",
"icon": "tool",
"is_active": 1,
"sort_order": 1
}
]
POST /support/categories
Create or update a support category.
Authentication: manage_options
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Category name |
slug | string | No | URL-friendly slug (auto-generated from name if empty) |
description | string | No | Category description |
color | string | No | Hex color (default: #3b82f6) |
icon | string | No | Icon name (default: ticket) |
is_active | bool | No | Whether category is active |
sort_order | int | No | Sort position |
auto_assign_to | int | No | User ID for auto-assignment |
DELETE /support/categories/{id}
Delete a support category.
Authentication: manage_options
Agents
Support agents are customer-designated users who can access tickets on specific licenses.
GET /support/agents
List agents. Non-admin users see agents for their own licenses.
Authentication: Logged-in user
POST /support/agents
Add a new agent to a license.
Authentication: Logged-in user (must own the license)
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
license_id | int | Yes | License to grant agent access on |
agent_email | string | Yes | Email address of the agent |
DELETE /support/agents/{id}
Remove an agent.
Authentication: Logged-in user (must own the associated license)
POST /support/agents/{id}/resend
Resend an agent invitation email.
Authentication: Logged-in user
Attachments
POST /support/attachments
Upload a file attachment for support tickets.
Authentication: Logged-in user
Send the file as a multipart form upload.
Example Request:
curl -X POST https://your-site.com/wp-json/slswc/v1/support/attachments \
-H "X-WP-Nonce: YOUR_NONCE" \
--cookie "wordpress_logged_in_xxx=..." \
-F "file=@/path/to/screenshot.png"
Users and Staff
GET /support/users
Search WordPress users (for admin ticket assignment).
Authentication: manage_options
GET /support/staff
Get available support staff members.
Authentication: manage_options
GET /support/my-licenses
Get the current user's licenses (used in the support form for license selection).
Authentication: Logged-in user