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 markRead() {
const response = await client.chat.read({
chat_id: '120363392071406466@g.us',
});
console.log(response);
}
markRead();curl -X POST \
https://api.periskope.app/v1/chats/{chat_id}/read \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
-d '{
"chat_id": "120363392071406466@g.us"
}'{}Chat APIs
Mark chat as read
This endpoint marks a unread chat as read.
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 markRead() {
const response = await client.chat.read({
chat_id: '120363392071406466@g.us',
});
console.log(response);
}
markRead();curl -X POST \
https://api.periskope.app/v1/chats/{chat_id}/read \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
-d '{
"chat_id": "120363392071406466@g.us"
}'{}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}}"
Path Parameters
- The unique id of the chat
- For individual chats, this would be the country_code + number (e.g., 918527184400), followed by @c.us
- For groups, this would end with @g.us
Example:
"120363392071406466@g.us"
Response
204 - application/json
204
204 No Content
Was this page helpful?