Page tree
Skip to end of metadata
Go to start of metadata

 

Description

This function lists all active and open support tickets from the cPanel Customer Portal.

Examples


 JSON API
https://hostname.example.com:2087/cpsess##########/json-api/ticket_list?api.version=1&ticket_id=999999999&server_num=2
 XML API
https://hostname.example.com:2087/cpsess##########/xml-api/ticket_list?api.version=1&ticket_id=999999999&server_num=2
 Command Line
whmapi1 ticket_list ticket_id=999999999 server_num=2

Notes:

  • You must URI-encode values.
  • For more information and additional output options, read our Guide to WHM API 1 documentation or run the whmapi1 --help command. 
  • We introduced this functionality in cPanel & WHM version 11.52.0.8.

 Output (JSON)
{
    "auths": [
        {
            "ticket_status": "UNKNOWN",
            "servers": [
                {
                    "ssh_username": "root",
                    "server_num": "2",
                    "auth_status": "AUTHED",
                    "ssh": "10.11.12.13:22",
                    "auth_time": 1400000000,
                    "whm_ip": "10.11.12.13",
                    "server_name": "My Server"
                }
            ],
            "ticket_subject": "Example ticket",
            "ticket_id": "9999999999999"
        }
    ]
}
 Output (XML)
<result>
    <data>
        <auths>
            <ticket_status>CLOSED</ticket_status>
            <servers>
                <ssh_username>root</ssh_username>
                <server_num>2</server_num>
                <auth_status>EXPIRED</auth_status>
                <ssh>10.11.12.13:22</ssh>
                <auth_time>1400603945</auth_time>
                <whm_ip>10.11.12.13</whm_ip>
                <server_name>My Server</server_name>
            </servers>
            <ticket_id>999999999</ticket_id>
        </auths>
    </data>
    <metadata>
        <version>1</version>
        <reason>OK</reason>
        <result>1</result>
        <command>ticket_list</command>
    </metadata>
</result>


Note:

Use WHM's API Shell interface (WHM >> Home >> Development >> API Shell) to directly test WHM API calls.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
ticket_idinteger

Required

The ticket's ID number.

A valid positive integer.999999999

server_num

integer

Required

The server's ID number.

A valid positive integer.

2
ssh_usernamestring

The username for incoming SSH connections before they escalate to the root user.

If you do not specify a value, the function will select the user from the ticket. 

A valid username.

root

Returns

ReturnTypeDescriptionPossible valuesExample
authshashA hash of the ticket authorization information.This hash includes the ticket_status and ticket_id returns and the servers hash. 

ticket_status

string

The ticket's status.

The function returns this value in the auths hash.

  • OPEN
  • CLOSED
  • UNKNOWN
OPEN

servers

hash

A hash of server information.

The function returns this hash in the auths hash.

This hash includes the ssh_username, auth_status, auth_time, ticket_id, ssh, whm_ip, server_num, and server_name returns. 

ssh_username

string

The username for incoming SSH connections before they escalate to the root user.

The function returns this value in the servers hash.

A valid username.

root

auth_status

string

The installation status.

The function returns this value in the servers hash.

  • AUTHED
  • NOT_AUTHED
  • EXPIRED
AUTHED

auth_time

integer

When the grant happened.

The function returns this value in the servers hash.

A valid date in Unix time format.
1400603208

ticket_id

integer

The ticket's ID number.

The function returns this value in the servers hash.

A valid positive integer.999999999

ssh

string

The server's IP address and port for SSH connections.

The function returns this value in the servers hash.

A valid IP address and port number.
10.11.12.13:22

whm_ip

string

The server's IP address for WHM connections.

The function returns this value in the servers hash.

A valid IP address.
10.11.12.13

server_num

integer

The server's ID number.

The function returns this value in the servers hash.

The function returns this value in the servers hash.

A valid positive integer.2

server_name

string

The server's human-readable description.

The function returns this value in the servers hash.

A valid string from the cPanel Customer Portal.
My Server

ticket_id

integer

The ticket's ID number.

The function returns this value in the auths hash.

A valid positive integer.999999999

non_fatals

array

Any non-fatal errors.

  • ticket_system_log_entry The function could not record the grant operation in the ticket.

  • audit_log The function could not record the grant operation in the local audit log.

Note:

The system stores the local audit log in the/var/cpanel/logs/supportauth/audit.log file.

2