Searching Tickets

This method allows you to search for tickets using the full text support.

URL

/api/v2/tickets/search

Access

This method can be accessed by account tokens and user tokens where the associated user has access to the tickets UI.

Supported Parameters

  • query - the query you wish to search for (required)
  • page - the page number you wish (optional, defaults to 1 if none provided)

Returned Data

The API will return an array of results paginated (30 per page). The data returned for the ticket is not as extensive as that returned elsewhere.

Example JSON

{
    "query": "test",
    "records": [
        {
            "ticket": {
                "id": 1,
                "reference": "HR-352858",
                "subject": "test",
                "submitted_at": "2013-02-13T11:46:53Z",
                "last_respondant": "user",
                "last_update_posted_at": "2013-02-13T11:46:54Z",
                "department": {
                    "id": 4,
                    "name": "Sales",
                    "brand": {
                        "id": 2,
                        "name": "Codebase",
                        "url": "http://www.codebasehq.com",
                        "phone": "01202 901 222"
                    },
                    "private": false
                },
                "status": {
                    "id": 1,
                    "name": "New",
                    "colour": "77c300",
                    "status_type": 0
                }
            },
            "highlights": [
                "{{{test}}} {{{test}}}"
            ]
        }
    ],
    "pagination": {
        "page": 1,
        "offset": 0,
        "per_page": 30,
        "pages": 1,
        "total_records": 1
    }
}