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 pinMessage() {
const response = await client.message.pin({
message_id: 'true_919487126251@c.us_3EB0F754E67BDF3178E76C680224FF7114E2CB95',
pin: true
});
console.log(response);
}
pinMessage();curl -X POST \
https://api.periskope.app/v1/message/{message_id}/pin \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
-d '{
"pin": true
}'{}Message APIs
Pin Message
This endpoint pins or unpins a message based on the message_id or queue_id
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 pinMessage() {
const response = await client.message.pin({
message_id: 'true_919487126251@c.us_3EB0F754E67BDF3178E76C680224FF7114E2CB95',
pin: true
});
console.log(response);
}
pinMessage();curl -X POST \
https://api.periskope.app/v1/message/{message_id}/pin \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
-d '{
"pin": true
}'{}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 message_id or the queue_id of the message to pin or unpin
Example:
"true_919487126251@c.us_3EB0F754E67BDF3178E76C680224FF7114E2CB95"
Body
application/json
Whether to pin (true) or unpin (false) the message
Example:
true
- Duration in days for how long the message stays pinned
- Accepted values: 1 (1 day), 7 (7 days), 30 (30 days)
- Defaults to 30 days if not provided
- Only applies when pin is true
Available options:
1, 7, 30 Example:
7
Response
204 - application/json
204
204 No Content
Was this page helpful?