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 editMessage() {
const response = await client.message.edit({
message_id: 'true_919487126251@c.us_3EB0F754E67BDF3178E76C680224FF7114E2CB95',
edited_body: 'Hello, Edited World'
});
console.log(response);
}
editMessage();curl -X POST \
https://api.periskope.app/v1/message/{message_id}/edit \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
-d '{
"edited_body": "Hello, Edited World"
}'{}Message APIs
Edit Message
This endpoint edits 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 editMessage() {
const response = await client.message.edit({
message_id: 'true_919487126251@c.us_3EB0F754E67BDF3178E76C680224FF7114E2CB95',
edited_body: 'Hello, Edited World'
});
console.log(response);
}
editMessage();curl -X POST \
https://api.periskope.app/v1/message/{message_id}/edit \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'x-phone: YOUR_PHONE_NUMBER' \
-d '{
"edited_body": "Hello, Edited World"
}'{}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 edited
Example:
"true_919537851844@c.us_3EB066173724CC4C6D272310AF6E912B08372C8E"
Body
application/json
- The edited message body
- Media content or polls cannot be edited. In the case of media, only the caption will be edited
- Edit is only possible for the first 15 minutes after the message is delivered
Example:
"Hello, Edited World"
Response
204 - application/json
204
204 No Content
Was this page helpful?