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 forwardMessage() {
const response = await client.message.forward({
message_id: 'true_919487126251@c.us_3EB0F754E67BDF3178E76C680224FF7114E2CB95',
forward_chat_ids: ['919289665999']
});
console.log(response);
}
forwardMessage();curl -X POST \
https://api.periskope.app/v1/message/{message_id}/forward \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
-d '{
"forward_chat_ids": ["919289665999"]
}'{
"919289665999@c.us": true
}Message APIs
Forward Message
This endpoint forwards a message to other chats
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 forwardMessage() {
const response = await client.message.forward({
message_id: 'true_919487126251@c.us_3EB0F754E67BDF3178E76C680224FF7114E2CB95',
forward_chat_ids: ['919289665999']
});
console.log(response);
}
forwardMessage();curl -X POST \
https://api.periskope.app/v1/message/{message_id}/forward \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
-d '{
"forward_chat_ids": ["919289665999"]
}'{
"919289665999@c.us": 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 be forwarded
Example:
"true_919487126251@c.us_3EB0F754E67BDF3178E76C680224FF7114E2CB95"
Body
application/json
- Array of all the recipients
- For groups, enter the chat_id of the group. This will be a string that ends with @g.us
- For 1-1 chats, enter the country_code + number of the recipient e.g. 919537851844@c.us (The @c.us is optional)
Example:
["919289665999@c.us"]
Response
204 - application/json
204 No Content
204 No Content
Was this page helpful?