Presence
Control and query WhatsApp presence with Wazend: online, offline, typing, recording and more.
Get presence information (online, offline with last seen, typing) from a contact if they share their presence information.
I don't receive notifications on my phone
You need to send offline after each presence you send (WhatsApp doesn't send notifications to the device if a web client is active).
Set presence
POST /api/{session}/presence{
"chatId": "5215551234567@c.us",
"presence": "typing"
}Possible presence states:
online— available (withoutchatId).offline— away (withoutchatId).typing— typing (requireschatId).recording— recording (requireschatId).paused— clears the state after typing (requireschatId).
Get presence from a chat
GET /api/{session}/presence/{chatId}{
"id": "5215551234567@c.us",
"presences": [
{
"participant": "5215551234567@c.us",
"lastKnownPresence": "online",
"lastSeen": null
}
]
}Subscribe to presence
Subscribe to receive presence updates through the presence.update webhook:
POST /api/{session}/presence/{chatId}/subscribeGet presence from all chats
GET /api/{session}/presenceReturns the presence of groups and personal chats. lastSeen contains the Unix timestamp of the last connection; lastKnownPresence can be offline, online, typing, recording or paused.
Typing indicator
You can use POST /api/startTyping and POST /api/stopTyping as shortcuts for presence=typing and presence=paused (see Typing indicator).
Events
Subscribe to the presence.update webhook to receive the most recent presence. See the payload details in Events.