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": "test@periskope.app",
"chat_id": "918527184400@c.us",
"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": "bharat@periskope.app",
"chat_id": "919537851844@c.us",
"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
}This endpoint retrieves a paginated list of tickets
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": "test@periskope.app",
"chat_id": "918527184400@c.us",
"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": "bharat@periskope.app",
"chat_id": "919537851844@c.us",
"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
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
"0"
"10"
200 OK
The starting index of the returned tickets.
The ending index of the returned tickets.
The total count of tickets.
An array of ticket objects. Refer to the ticket object here
Was this page helpful?