Skip to main content

Queue

Method#

/queue#

GET https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/queue

Header#

KeyValue
Client-TokenACCOUNT SECURITY TOKEN

Concept#

This method is responsible for returning all messages that are in your queue waiting to be processed.


Attributes#

Required#

AttributesTypeDescription
pageintegerUsed for pagination, you need to inform here the message page you want to retrieve
pageSizeintegerSpecify the size of the message return per page

Optionals#

AttributesTypeDescription

Request Params#

URL example#

Method

GET https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/queue?page=1&pageSize=100

or

GET https://api.z-api.io/instances/YOUR_INSTANCE/token/YOUR_TOKEN/queue/count


Response#

200#

AttributesTypeDescription
sizestringNumber of messages in queue
messagesarray stringArray with queue messages

Messages Array

AttributesTypeDescription
sizestringNumber of messages in queue
MessagestringText message
PhonestringRecipients phone
ZaapIdstringZ-API message ID
CreatedtimetampMessages date
MessageIdstringMessage ID

Example

{
"size": 2,
"messages": [
{
"Message": "Mensagem da fila 1",
"Phone": "5511999999999",
"ZaapId": "39BB1684570F00E91090F6BBC7EE7646",
"Created": 1624977905648,
"MessageId": "7AD29EAA5EF34C301F0B"
},
{
"Message": "Mensagem da fila 2",
"Phone": "5511999999999",
"ZaapId": "39BB1685172AB008542A7E0B862A54DF",
"Created": 1624977906907,
"MessageId": "517AEF0FDE834DADJJFC8"
}
]
}

405#

Neste caso certifique que esteja enviando o corretamente a especificação do método, ou seja verifique se você enviou o POST ou GET conforme especificado no inicio deste tópico.

415#

In 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”


Code#