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 checkContact() {
const response = await client.contact.checkExists({
contact_ids: ['919537851844', '919876543210']
});
console.log(response);
}
checkContact();curl -X POST \
https://api.periskope.app/v1/contacts/check \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
-d '{
"contact_ids": ["919537851844", "919876543210"]
}'[
{
"contact_id": "919537851844@c.us",
"exists": true
},
{
"contact_id": "919876543210@c.us",
"exists": false
}
]Contact APIs
Check Contact Exists
This endpoint checks if contacts exist on WhatsApp
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 checkContact() {
const response = await client.contact.checkExists({
contact_ids: ['919537851844', '919876543210']
});
console.log(response);
}
checkContact();curl -X POST \
https://api.periskope.app/v1/contacts/check \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
-d '{
"contact_ids": ["919537851844", "919876543210"]
}'[
{
"contact_id": "919537851844@c.us",
"exists": true
},
{
"contact_id": "919876543210@c.us",
"exists": false
}
]Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Please provide the number of the phone you want to call with this API in the header. The number must be in country code + number format without any characters or spaces, e.g. 919876543210; Alternatively, provide the phone_id (phone-xxxxxxxxxxxx) in the header
Example:
"{{orgPhone}}"
Body
application/json
- Array of contact IDs to check. Must be formatted as country_code + number (e.g., 918527184400). It should be a non-empty array
Example:
["919537851844", "919876543210"]
Was this page helpful?