import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});
async function getContact() {
const response = await client.contact.getById({
chat_id: '919537851844'
});
console.log(response);
}
getContact();{
"chat_ids": [
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]"
],
"contact_color": "#FA6533",
"contact_id": "[email protected]",
"contact_image": "https://storage.googleapis.com/periskope-images/2997dd64-89bf-48d3-9a22-b314fca017e5%2F919537851844%40c.us.jpg?timestamp=1737445692504",
"contact_name": "BK Local1",
"contact_type": "user",
"is_imported": null,
"is_internal": false,
"is_my_contact": null,
"is_wa_contact": false,
"label_ids": {
"label-ukjqhqngnakncalm": true,
"label-wwfrdqogccexahnv": true
},
"labels": [
"label1",
"label2"
],
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"updated_at": "2025-01-22T05:41:15.303874+00:00"
}This endpoint retrieves a specific contact along with all associated chat_ids (1-1 chats and common groups).
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});
async function getContact() {
const response = await client.contact.getById({
chat_id: '919537851844'
});
console.log(response);
}
getContact();{
"chat_ids": [
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]",
"[email protected]"
],
"contact_color": "#FA6533",
"contact_id": "[email protected]",
"contact_image": "https://storage.googleapis.com/periskope-images/2997dd64-89bf-48d3-9a22-b314fca017e5%2F919537851844%40c.us.jpg?timestamp=1737445692504",
"contact_name": "BK Local1",
"contact_type": "user",
"is_imported": null,
"is_internal": false,
"is_my_contact": null,
"is_wa_contact": false,
"label_ids": {
"label-ukjqhqngnakncalm": true,
"label-wwfrdqogccexahnv": true
},
"labels": [
"label1",
"label2"
],
"org_id": "2997dd64-89bf-48d3-9a22-b314fca017e5",
"updated_at": "2025-01-22T05:41:15.303874+00:00"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
country_code + number (e.g., 918527184400). Do not include special characters"919537851844"
200 OK
The response is a contact object. Refer to the contact object here
Was this page helpful?