API
- Introduction
- Authorization
- SDK
- Objects
Chat APIs
Group Settings APIs
Message APIs
Contact APIs
Phone APIs
Webhooks
chat.created
The chat.created
webhook is triggered when a new group or individual chat is created on whatsapp.
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});
client.on('chat.created', (data) => {
console.log(data);
});
Refer Chat object to find more details about chat object
.
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});
client.on('chat.created', (data) => {
console.log(data);
});
Event structure 📦
You’ll be receiving the data in the following format:
{
"event": "<event-type>",
"data": "<event-data>", // complete data object as mentioned in Objects section
"org_id": "<your-organisation-id>",
"previous_attributes": "<previous-attributes>", // attributes changes in new object. In case of an update event.
"timestamp": "<timestamp>" // timestamp of the event creation
}
Was this page helpful?
import { PeriskopeApi } from '@periskope/periskope-client';
const client = new PeriskopeApi({
authToken: 'YOUR_API_KEY',
phone: 'YOUR_PHONE_NUMBER', // e.g., '919876543210'
});
client.on('chat.created', (data) => {
console.log(data);
});
Assistant
Responses are generated using AI and may contain mistakes.