Table of Contents

Chat information

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.

Request command

To retrieve chat info, send a POST request to:

https://whatsgate.org/api/v1/get-chats

Request body object

The request body must contain:

{
  "WhatsappID": "YOUR_WHATSAPP_ID"
}

Response object

Successful response object

{
  "result": "OK",
  "data": [
    { ... CHAT_CONTACT_OBJECT ... }
    ...
  ]
}

data - contains an array of chat contact objects or chat group objects

Chat contact object

{
  "id" : "79991112233@c.us",
  "name" : "Vasily",
  "isGroup" : false,
  "isReadOnly" : false,
  "unreadCount" : 0,
  "timestamp" : 1662710454,
  "pinned" : false,
  "isMuted" : false,
  "muteExpiration" : 0
}

Chat group object

{
  "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 ...}
 }

Group metadata object

{
  "id" : "4239048293082@g.us",
  "creation" : 1658328976,
  "owner" : "79991112233@c.us",
  "size" : 3,
  "participants" : [
     { ... PARTICIPANT_OBJECT ...}
     ...
  ]
}
  
  

Group participant object

{
  "id" : "79156666555@c.us",
  "isAdmin" : true,
  "isSuperAdmin" : false
}

Full response example

{
  "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
           }
        ]
      }
    }
  ]
}