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

GET /Tickets/Ticket/ListAll/$departmentid$/$ticketstatusid$/$ownerstaffid$/$userid$/$count$/$start$/$sortField$/$sortOrder$

Retrieve a filtered list of tickets from the help desk.

Arguments

Red = required

Name

Description

$departmentid$

Filter the tickets by the specified department id, you can specify multiple id's by separating the values using a comma. Example: 1,2,3

$ticketstatusid$

Filter the tickets by the specified ticket status id, you can specify multiple id's by separating the values using a comma. Example: 1,2,3

$ownerstaffid$

Filter the tickets by the specified owner staffid, you can specify multiple id's by separating the values using a comma. Example: 1,2,3

$userid$

Filter the tickets by the specified user id, you can specify multiple id's by separating the values using a comma. Example: 1,2,3

$count$

Total items count for retrieval

$start$

Start item for retrieval. It's a mandatory field while passing $count$ parameter

$sortField$

Sort items according to a single specified field

$sortOrder$

Sort items according to a single specified order

If you do not wish to filter a value based on ownerid or staff user id, you can send '-1' as a value. Example: /Tickets/Ticket/ListAll/41/1/-1/-1/-1/-1/ticketid/ASC/

Response

<tickets>
    <ticket id="2" flagtype="0">
        <displayid>OLJ-171-16930</displayid>
        <departmentid>2</departmentid>
        <statusid>1</statusid>
        <priorityid>1</priorityid>
        <typeid>1</typeid>
        <userid>1</userid>
        <userorganization>Test</userorganization>
        <userorganizationid>1</userorganizationid>
        <ownerstaffid>0</ownerstaffid>
        <ownerstaffname />
        <fullname>Varun Shoor</fullname>
        <email>varun.shoor@kayako.com</email>
        <lastreplier>Varun Shoor</lastreplier>
        <subject>This is just a test</subject>
        <creationtime>1297840147</creationtime>
        <lastactivity>1297840147</lastactivity>
        <laststaffreply>0</laststaffreply>
        <lastuserreply>1297840147</lastuserreply>
        <slaplanid>1</slaplanid>
        <nextreplydue>1297883347</nextreplydue>
        <resolutiondue>1298012947</resolutiondue>
        <replies>0</replies>
        <ipaddress>127.0.0.1</ipaddress>
        <creator>2</creator>
        <creationmode>1</creationmode>
        <creationtype>1</creationtype>
        <isescalated>0</isescalated>
        <escalationruleid>0</escalationruleid>
        <templategroupid>1</templategroupid>
        <templategroupname>default</templategroupname>
        <tags>test tag client</tags>
        <watcher staffid="1" name="Varun Shoor" />
        <workflow id="1" title="Close Ticket" />
        <note type="ticket" id="1" ticketid="2" notecolor="1" creatorstaffid="1" forstaffid="0" creatorstaffname="Varun Shoor" creationdate="1297842417">This is a ticket note</note>
        <note type="user" id="1" userid="1" notecolor="1" creatorstaffid="1" forstaffid="0" creatorstaffname="Varun Shoor" creationdate="1297842435">This is a test User note</note>
        <note type="userorganization" id="1" userorganizationid="1" notecolor="1" creatorstaffid="1" forstaffid="0" creatorstaffname="Varun Shoor" creationdate="1297842447">This is a test User Organization note</note>
        <note type="timetrack" id="1" ticketid="2" timeworked="1800" timebillable="1800" billdate="1297842420" workdate="1297842420" workerstaffid="1" workerstaffname="Varun Shoor" creatorstaffid="1" creatorstaffname="Varun Shoor" notecolor="1">This is a test time track entry for thirty minutes</note>
    </ticket>
</tickets>

 

GET /Tickets/Ticket/$ticketid$/

Retrieve the ticket identified by $ticketid$.

Arguments

Red = required

Name

Description

$ticketid$

The unique numeric identifier of the ticket or the ticket mask ID (e.g. ABC-123-4567).

Response

<tickets>
    <ticket id="2" flagtype="0">
        <displayid>OLJ-171-16930</displayid>
        <departmentid>2</departmentid>
        <statusid>1</statusid>
        <priorityid>1</priorityid>
        <typeid>1</typeid>
        <userid>1</userid>
        <userorganization>Test</userorganization>
        <userorganizationid>1</userorganizationid>
        <ownerstaffid>0</ownerstaffid>
        <ownerstaffname />
        <fullname>Varun Shoor</fullname>
        <email>varun.shoor@kayako.com</email>
        <lastreplier>Varun Shoor</lastreplier>
        <subject>This is just a test</subject>
        <creationtime>1297840147</creationtime>
        <lastactivity>1297840147</lastactivity>
        <laststaffreply>0</laststaffreply>
        <lastuserreply>1297840147</lastuserreply>
        <slaplanid>1</slaplanid>
        <nextreplydue>1297883347</nextreplydue>
        <resolutiondue>1298012947</resolutiondue>
        <replies>0</replies>
        <ipaddress>127.0.0.1</ipaddress>
        <creator>2</creator>
        <creationmode>1</creationmode>
        <creationtype>1</creationtype>
        <isescalated>0</isescalated>
        <escalationruleid>0</escalationruleid>
        <templategroupid>1</templategroupid>
        <templategroupname>default</templategroupname> 
        <tags>test tag client</tags>
        <watcher staffid="1" name="Varun Shoor" />
        <workflow id="1" title="Close Ticket" />
        <note type="ticket" id="1" ticketid="2" notecolor="1" creatorstaffid="1" forstaffid="0" creatorstaffname="Varun Shoor" creationdate="1297842417">This is a ticket note</note>
        <note type="user" id="1" userid="1" notecolor="1" creatorstaffid="1" forstaffid="0" creatorstaffname="Varun Shoor" creationdate="1297842435">This is a test User note</note>
        <note type="userorganization" id="1" userorganizationid="1" notecolor="1" creatorstaffid="1" forstaffid="0" creatorstaffname="Varun Shoor" creationdate="1297842447">This is a test User Organization note</note>
        <note type="timetrack" id="1" ticketid="2" timeworked="1800" timebillable="1800" billdate="1297842420" workdate="1297842420" workerstaffid="1" workerstaffname="Varun Shoor" creatorstaffid="1" creatorstaffname="Varun Shoor" notecolor="1">This is a test time track entry for thirty minutes</note>
        <posts>
            <post>
                <id>2</id>
                <ticketid>2</ticketid>
                <dateline>1297840147</dateline>
                <userid>1</userid>
                <fullname>Varun Shoor</fullname>
                <email>varun.shoor@kayako.com</email>
                <emailto />
                <ipaddress>127.0.0.1</ipaddress>
                <hasattachments>0</hasattachments>
                <creator>2</creator>
                <isthirdparty>0</isthirdparty>
                <ishtml>0</ishtml>
                <isemailed>0</isemailed>
                <staffid>0</staffid>
                <issurveycomment>0</issurveycomment>
                <contents><![CDATA[I am just testing]]]]><![CDATA[></contents>
            </post>
        </posts>
    </ticket>
</tickets>

 

POST /Tickets/Ticket

API supported in version > v4.01.220

 

Create a new ticket.

Arguments (POST variables)

Red = required, Blue = Either of the value, Green = Optional Variables

Name

Description

subject

The Ticket Subject

fullname

Full Name of creator

email

Email Address of creator

contents

The contents of the first ticket post

departmentid

The Department ID

ticketstatusid

The Ticket Status ID

ticketpriorityid

The Ticket Priority ID

tickettypeid

The Ticket Type ID

autouserid

If dispatched as "1" then the User ID is looked up based on the email address, if none is found, the system ends up creating a new user based on the information supplied.

userid

The User ID, if the ticket is to be created as a user.

staffid

The Staff ID, if the ticket is to be created as a staff

ownerstaffid

The Owner Staff ID, if you want to set an Owner for this ticket

type

The ticket type: 'default' or 'phone'

templategroup

The custom template group identifier (ID or Name) for the Ticket. This is only available in version upwards of 4.40.954.

ignoreautoresponder

Option to disable autoresponderemail, if is set to 1.  This is only available in version upwards of 4.40.1079.

emailqueueidOption to select email queue ID, This is only available in version upwards of 4.70

Response

<tickets>
    <ticket id="2" flagtype="0">
        <displayid>OLJ-171-16930</displayid>
        <departmentid>2</departmentid>
        <statusid>1</statusid>
        <priorityid>1</priorityid>
        <typeid>1</typeid>
        <userid>1</userid>
        <userorganization>Test</userorganization>
        <userorganizationid>1</userorganizationid>
        <ownerstaffid>0</ownerstaffid>
        <ownerstaffname />
        <fullname>Varun Shoor</fullname>
        <email>varun.shoor@kayako.com</email>
        <lastreplier>Varun Shoor</lastreplier>
        <subject>This is just a test</subject>
        <creationtime>1297840147</creationtime>
        <lastactivity>1297840147</lastactivity>
        <laststaffreply>0</laststaffreply>
        <lastuserreply>1297840147</lastuserreply>
        <slaplanid>1</slaplanid>
        <nextreplydue>1297883347</nextreplydue>
        <resolutiondue>1298012947</resolutiondue>
        <replies>0</replies>
        <ipaddress>127.0.0.1</ipaddress>
        <creator>2</creator>
        <creationmode>1</creationmode>
        <creationtype>1</creationtype>
        <isescalated>0</isescalated>
        <escalationruleid>0</escalationruleid>
        <templategroupid>1</templategroupid>
        <templategroupname>default</templategroupname>
        <tags>test tag client</tags>
        <watcher staffid="1" name="Varun Shoor" />
        <workflow id="1" title="Close Ticket" />
        <note type="ticket" id="1" ticketid="2" notecolor="1" creatorstaffid="1" forstaffid="0" creatorstaffname="Varun Shoor" creationdate="1297842417">This is a ticket note</note>
        <note type="user" id="1" userid="1" notecolor="1" creatorstaffid="1" forstaffid="0" creatorstaffname="Varun Shoor" creationdate="1297842435">This is a test User note</note>
        <note type="userorganization" id="1" userorganizationid="1" notecolor="1" creatorstaffid="1" forstaffid="0" creatorstaffname="Varun Shoor" creationdate="1297842447">This is a test User Organization note</note>
        <note type="timetrack" id="1" ticketid="2" timeworked="1800" timebillable="1800" billdate="1297842420" workdate="1297842420" workerstaffid="1" workerstaffname="Varun Shoor" creatorstaffid="1" creatorstaffname="Varun Shoor" notecolor="1">This is a test time track entry for thirty minutes</note>
        <posts>
            <post>
                <id>2</id>
                <ticketid>2</ticketid>
                <dateline>1297840147</dateline>
                <userid>1</userid>
                <fullname>Varun Shoor</fullname>
                <email>varun.shoor@kayako.com</email>
                <emailto />
                <ipaddress>127.0.0.1</ipaddress>
                <hasattachments>0</hasattachments>
                <creator>2</creator>
                <isthirdparty>0</isthirdparty>
                <ishtml>0</ishtml>
                <isemailed>0</isemailed>
                <staffid>0</staffid>
                <issurveycomment>0</issurveycomment>
                <contents><![CDATA[I am just testing]]]]><![CDATA[></contents>
            </post>
        </posts>
    </ticket>
</tickets>

 

PUT /Tickets/Ticket/$ticketid$

API supported in version > 4.01.192

 

Update the ticket identified by $ticketid$

Arguments (POST variables)

Green = Optional Variables

Name

Description

subject

The Ticket Subject

fullname

Full Name of creator

email

Email Address of creator

departmentid

The Department ID

ticketstatusid

The Ticket Status ID

ticketpriorityid

The Ticket Priority ID

tickettypeid

The Ticket Type ID

ownerstaffid

The Owner Staff ID, if you want to set an Owner for this ticket

userid

The User ID, if you want to change the user for this ticket

templategroup

The custom template group identifier (ID or Name) for the Ticket. This is only available in version upwards of 4.40.833.

Response

<tickets>
    <ticket id="2" flagtype="0">
        <displayid>OLJ-171-16930</displayid>
        <departmentid>2</departmentid>
        <statusid>1</statusid>
        <priorityid>1</priorityid>
        <typeid>1</typeid>
        <userid>1</userid>
        <userorganization>Test</userorganization>
        <userorganizationid>1</userorganizationid>
        <ownerstaffid>0</ownerstaffid>
        <ownerstaffname />
        <fullname>Varun Shoor</fullname>
        <email>varun.shoor@kayako.com</email>
        <lastreplier>Varun Shoor</lastreplier>
        <subject>This is just a test</subject>
        <creationtime>1297840147</creationtime>
        <lastactivity>1297840147</lastactivity>
        <laststaffreply>0</laststaffreply>
        <lastuserreply>1297840147</lastuserreply>
        <slaplanid>1</slaplanid>
        <nextreplydue>1297883347</nextreplydue>
        <resolutiondue>1298012947</resolutiondue>
        <replies>0</replies>
        <ipaddress>127.0.0.1</ipaddress>
        <creator>2</creator>
        <creationmode>1</creationmode>
        <creationtype>1</creationtype>
        <isescalated>0</isescalated>
        <escalationruleid>0</escalationruleid>
        <templategroupid>1</templategroupid>
        <templategroupname>default</templategroupname> 
        <tags>test tag client</tags>
        <watcher staffid="1" name="Varun Shoor" />
        <workflow id="1" title="Close Ticket" />
        <note type="ticket" id="1" ticketid="2" notecolor="1" creatorstaffid="1" forstaffid="0" creatorstaffname="Varun Shoor" creationdate="1297842417">This is a ticket note</note>
        <note type="user" id="1" userid="1" notecolor="1" creatorstaffid="1" forstaffid="0" creatorstaffname="Varun Shoor" creationdate="1297842435">This is a test User note</note>
        <note type="userorganization" id="1" userorganizationid="1" notecolor="1" creatorstaffid="1" forstaffid="0" creatorstaffname="Varun Shoor" creationdate="1297842447">This is a test User Organization note</note>
        <note type="timetrack" id="1" ticketid="2" timeworked="1800" timebillable="1800" billdate="1297842420" workdate="1297842420" workerstaffid="1" workerstaffname="Varun Shoor" creatorstaffid="1" creatorstaffname="Varun Shoor" notecolor="1">This is a test time track entry for thirty minutes</note>
        <posts>
            <post>
                <id>2</id>
                <ticketid>2</ticketid>
                <dateline>1297840147</dateline>
                <userid>1</userid>
                <fullname>Varun Shoor</fullname>
                <email>varun.shoor@kayako.com</email>
                <emailto />
                <ipaddress>127.0.0.1</ipaddress>
                <hasattachments>0</hasattachments>
                <creator>2</creator>
                <isthirdparty>0</isthirdparty>
                <ishtml>0</ishtml>
                <isemailed>0</isemailed>
                <staffid>0</staffid>
                <issurveycomment>0</issurveycomment>
                <contents><![CDATA[I am just testing]]]]><![CDATA[></contents>
            </post>
        </posts>
    </ticket>
</tickets>

 

DELETE /Tickets/Ticket/$ticketid$

Delete the ticket identified by $ticketid$.

Arguments

Red = required

Name

Description

$ticketid$

The unique numeric identifier of the ticket.

 

 

  • No labels

19 Comments

  1. Unknown User (dhall)

    Under POST /Tickets/Ticket, the optional parameter "templategroupid" should be "templategroup" and according to the source code can the the group name or id at least that's true for v4.40.959.

    1. I've updated the page.

  2. Unknown User (southrivertech)

    Hi,

     I'd like to see a sample showing how to use POST /Tickets/Ticket/ to create a new ticket and, at the same time, specify values for any custom fields that I have defined in my system. I have custom fields "Registration Code" as shown below, how can I add the registration code to the list of parameters sent over in the POST during ticket createion?

    <customfields>

    <group id="2" title="Mac Product Registration Information">

    <field id="8" title="Registration Code" type="1" name="796738cea4" />

    <field id="9" title="Program Version/Build #" type="1" name="368bede5c6" />

    </group>

    </customfields>

    1. You can't do it in one request. The same is for attachments. You must:
      1. Create ticket.
      2. Create ticket custom fields.
      3. Optionally add attachment to the first post of the ticket.

      See SWIFT-2391 feature request.

  3. Unknown User (will.rayner@papercut.com)

    I'd like to know a bit more about the listall ticket api.

    The python library specifies it won't return more than 1000 results. How are the tickets that are returned selected? Is it the most recent ones?

    1. As far as I know, there's no limit for number of tickets returned on Kayako server side. Either it's a documentation error in Python library or Python library limitation.

      1. Unknown User (will.rayner@papercut.com)

        Great, I'll hopefully be able to confirm this later in the week.

        As far as I can see, tickets are returns in order of last activity date, from oldest to newest. Can you confirm?

        1. I didn't find any ORDER BY in the code, so the order would be undefined (depends on how the database will return them) but most probably from lowest to highest internal ticket id (which would be the same as oldest to newest by creation date).

          1. Unknown User (nagarjuna.rachaneni@abinnovative.com)

            Order of tickets can be handled with any other parameters in the list API ? and also can it be retrieve the total count of the tickets in this API ?

  4. Unknown User (nagarjuna.rachaneni@abinnovative.com)

    Is there a way to fetch ticket in pagination ?? my customers have thousands of tickets in their account and when they come to list page it causing my application down. Please suggest to fix the performance issue

    Thank you

  5. Unknown User (pac09)

    Hello guys, I would like to know If this has happen to some of you. I'm having the Auto-Response sent to the user twice. How do I disable this? Thanks

  6. Hi Pastor,

    We are already know about the reported issue. This issue has been marked as a bug in our JIRA portal. You may refer to the following link and apply the fix provided over there.

    http://dev.kayako.com/browse/SWIFT-2941.

    Please submit a support ticket, If you still face any issue.

    Thanks

  7. Unknown User (persefer@hotmail.com)

    Hi All,

    My GET and POST operations are working properly. I use PHP and cURL function. But PUT operation gives 411 Length Required - nginx/1.2.3 error. Do you have any idea how must I change my code? I m trying to change the status of the ticket.

    $post_data = array(
        'ticketstatusid' => $ticketstatusid,
        'apikey' => $apiKey,
        'salt' => $salt,
        'signature' => $signature);

        $post_data = http_build_query($post_data);

        $curl = curl_init($apiUrl);
        curl_setopt($curl, CURLOPT_URL, $apiUrl);
        curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt($curl, CURLOPT_PUT, true);
        curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT');
        curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($curl, CURLOPT_POSTFIELDS, $post_data);

        $response = curl_exec($curl);  
        curl_close($curl);
        
        print_r($response);

    1. Could you please specify the Content-Length header to zero and check if still face this issue?

      1. Unknown User (persefer@hotmail.com)

        Yes I set it as 0 but didn't work.

        curl_setopt($curl, CURLOPT_HTTPHEADER, 'Content-Length: 0' );

        1. Can you please remove header length and try by:

          Replacing:

          curl_setopt($curl, CURLOPT_PUT, true);

          With:

          curl_setopt($curl, CURLOPT_POST, true);

          Please let me know if it works for you.

  8. Unknown User (nagarjuna.rachaneni@abinnovative.com)

    Thanks for adding pagination on /Tickets/Ticket/ListAll API but the result is giving in reverse order. When i retrieved closed tickets it is giving me the results based on lastactivity by ASC but   it should be lastactivity ASC. So recently closed tickets should come in the first page. Is there any way to pass the sorting filter to this API ?

    Thank you,

    Nagarjuna

  9. Can I retrieve a filtered list of tickets from the help desk using Organization Name?  I don't see that listed above.

    1. Hi Chris,

      In order to retrieve the tickets for a particular user organization, you may try Ticket Search API and use 'userorganization' as criteria builder. Please refer Ticket Search.