This command returns information about all active chats for the client. The response includes the contact list (including groups) and group participants with their permissions.
To retrieve chat info, send a POST request to:
https://whatsgate.org/api/v1/get-chats
The request body must contain:
{
"WhatsappID": "YOUR_WHATSAPP_ID"
}
Successful response object
{
"result": "OK",
"data": [
{ ... CHAT_CONTACT_OBJECT ... }
...
]
}
data - contains an array of chat contact objects or chat group objects
{
"id" : "79991112233@c.us",
"name" : "Vasily",
"isGroup" : false,
"isReadOnly" : false,
"unreadCount" : 0,
"timestamp" : 1662710454,
"pinned" : false,
"isMuted" : false,
"muteExpiration" : 0
}
{
"id" : "4239048293082@g.us",
"name" : "Test group",
"isGroup" : true,
"isReadOnly" : false,
"unreadCount" : 0,
"timestamp" : 1662616476,
"pinned" : false,
"isMuted" : false,
"muteExpiration" : 0
"groupMetadata" : {... GROUP_METADATA_OBJECT ...}
}
{
"id" : "4239048293082@g.us",
"creation" : 1658328976,
"owner" : "79991112233@c.us",
"size" : 3,
"participants" : [
{ ... PARTICIPANT_OBJECT ...}
...
]
}
{
"id" : "79156666555@c.us",
"isAdmin" : true,
"isSuperAdmin" : false
}
{
"result":"OK",
"data" : [
{
"id" : "79999999999@c.us",
"name" : "+7 999 999-99-99",
"isGroup" : false,
"isReadOnly" : false,
"unreadCount" : 0,
"timestamp" : 1662710454,
"pinned" : false,
"isMuted" : false,
"muteExpiration" : 0
},
{
"id" : "4239048293082@g.us",
"name" : "Test group",
"isGroup" : true,
"isReadOnly" : false,
"unreadCount" : 0,
"timestamp" : 1662616476,
"pinned" : false,
"isMuted" : false,
"muteExpiration" : 0,
"groupMetadata" : {
"id" : "4239048293082@g.us",
"creation" : 1658328976,
"owner" : "79999999999@c.us",
"size" : 0,
"participants" : [
{
"id" : "79999999999@c.us",
"isAdmin" : true,
"isSuperAdmin" : false
},
{
"id" : "79991112233@c.us",
"isAdmin" : false,
"isSuperAdmin":false
}
]
}
}
]
}