Support Endpoints

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:

NameTypeRequiredDescription
statusstringNoFilter by status (open, in_progress, waiting, resolved, closed)
searchstringNoSearch 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:

NameTypeRequiredDescription
subjectstringYesTicket subject
messagestringYesInitial message body
category_idintYesSupport category ID
license_idintNoAssociated license ID
license_keystringNoAssociated license key
prioritystringNolow, normal, high, urgent (default: normal)
is_publicboolNoFlag for public (guest) submissions
guest_namestringNoGuest name (for unauthenticated tickets)
guest_emailstringNoGuest 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:

NameTypeRequiredDescription
actionstringYesAction to perform: reply, status, assign, priority
messagestringConditionalRequired for reply action
message_idintConditionalRequired for reply notification
new_statusstringConditionalRequired for status action
agent_idintConditionalRequired for assign action
prioritystringConditionalRequired for priority action
is_internalboolNoMark 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:

NameTypeRequiredDescription
namestringYesCategory name
slugstringNoURL-friendly slug (auto-generated from name if empty)
descriptionstringNoCategory description
colorstringNoHex color (default: #3b82f6)
iconstringNoIcon name (default: ticket)
is_activeboolNoWhether category is active
sort_orderintNoSort position
auto_assign_tointNoUser 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:

NameTypeRequiredDescription
license_idintYesLicense to grant agent access on
agent_emailstringYesEmail 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

Was this article helpful?