Get chats
#
Method#
/chatsGET
https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/chats
#
HeaderKey | Value |
---|---|
Client-Token | ACCOUNT SECURITY TOKEN |
#
ConceptThis method is responsible for returning all of your chats
#
Attributes#
RequiredAttributes | Type | Description |
---|---|---|
page | integer | Used for pagination, you must inform the page of chats you want to search. |
pageSize | integer | Specifies the size of the return chats per page |
#
OpcionaisAttributes | Type | Description |
---|---|---|
#
Request Params#
URL exampleMethod
GET
https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/chats
#
Response#
200Attributes | Type | Description |
---|---|---|
name | string | Name assigned to the chat, remembering that if it is a group or a broadcast list, you must return the respective IDs |
phone | string | Contact’s phone |
unread | string | Indicates the number of messages that haven’t been read in a chat |
lastMessageTime | string | Timestamp with date and time of your last interaction with that chat |
isMuted | string | 0 or 1 indicates if you have silenced or not a certain chat |
isMarkedSpam | boolean | True or false indicates if you have marked a chat as spam |
profileThumbnail | string | Chat photo URL that WhatsApp deletes after 48h |
messagesUnread | integer | discontinued |
Example
#
405In this case certify that you are sending the correct specification of the method. This means, verify if you sent a POST or GET as specified at the beginning of this topic.
#
415In case you receive 415 error, make sure to add the “Content-Type” of the object you are sending in the request headers, mostly “application/json”