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 leaveGroup() {
const response = await client.group.leaveGroup({
chat_id: '120363371308389685@g.us'
});
console.log(response);
}
leaveGroup();curl -X POST \
https://api.periskope.app/v1/chats/{chat_id}/leave \
-H 'Authorization: Bearer <token>' \
-H 'x-phone: YOUR_PHONE_NUMBER'{}Group Settings APIs
Leave Group
This endpoint allows a participant to leave a group
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 leaveGroup() {
const response = await client.group.leaveGroup({
chat_id: '120363371308389685@g.us'
});
console.log(response);
}
leaveGroup();curl -X POST \
https://api.periskope.app/v1/chats/{chat_id}/leave \
-H 'Authorization: Bearer <token>' \
-H 'x-phone: YOUR_PHONE_NUMBER'{}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
Example:
"120363371308389685@g.us"
Response
200 - application/json
200 OK
200 No Content
Was this page helpful?