Skip to main content
GET
/
tickets
Node.js
import { PeriskopeApi } from '@periskope/periskope-client';

const client = new PeriskopeApi({
  authToken: 'YOUR_API_KEY',
  phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});

async function getTickets() {
  const response = await client.ticket.getAll();

  console.log(response);
}

getTickets();
{
  "count": 2,
  "from": 1,
  "tickets": [
    {
      "assigned_by": null,
      "assignee": "[email protected]",
      "chat_id": "[email protected]",
      "close_ticket_metadata": {},
      "closed_at": null,
      "created_at": "2025-01-26T13:46:55.758677+00:00",
      "custom_properties": {},
      "due_date": null,
      "freshdesk_metadata": {},
      "hubspot_metadata": {},
      "is_deleted": false,
      "label_ids": {},
      "labels": [],
      "last_updated_at": "2025-01-26T13:46:55.758677+00:00",
      "org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
      "priority": 0,
      "quoted_message_id": null,
      "raised_by": null,
      "response_time": null,
      "status": "inprogress",
      "subject": "Another ticket",
      "ticket_id": "BKT-002",
      "zohodesk_metadata": {}
    },
    {
      "assigned_by": null,
      "assignee": "[email protected]",
      "chat_id": "[email protected]",
      "close_ticket_metadata": {},
      "closed_at": null,
      "created_at": "2025-01-26T13:46:21.670006+00:00",
      "custom_properties": {},
      "due_date": null,
      "freshdesk_metadata": {},
      "hubspot_metadata": {},
      "is_deleted": false,
      "label_ids": {},
      "labels": [],
      "last_updated_at": "2025-01-26T13:46:21.670006+00:00",
      "org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
      "priority": 0,
      "quoted_message_id": null,
      "raised_by": null,
      "response_time": null,
      "status": "open",
      "subject": "Issue with this",
      "ticket_id": "BKT-001",
      "zohodesk_metadata": {}
    }
  ],
  "to": 2
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

offset
number
  • The offset value for paginating the results
  • Default 0
Example:

"0"

limit
number
  • The maximum number of tickets to retrieve
  • Default 2000
Example:

"10"

Response

200 - application/json

200 OK

from
number

The starting index of the returned tickets.

to
number

The ending index of the returned tickets.

count
number

The total count of tickets.

tickets
array

An array of ticket objects. Refer to the ticket object here