Queue list

hey guys
im trying to get the queued chats from list_chats endpoint but it returns a paged archive from all cgats from begining of using livechat till now
is there anyway to restrict the response to the queued(waiting and not yet assigned to an agent) chats?
im using this endpoint:

https://api.livechatinc.com/v3.3/agent/action/list_chats

this is my request body:

{ “filters”:{“type”:“Activity”,“operator”:“is”,“value”:[“queued”]}}

Hi! :wave:

Unfortunately, we do not have a filter that would provide you only with queued chats. You can of course call list_chats method, but to check which chats are queued, you would need to additionally filter the response our at your side, by looking for the following object (example):

"queue": {
                    "position": 1,
                    "wait_time": 214,
                    "queued_at": "2021-12-20T16:16:28.543963Z"
                }

If this object is found, it means that the chat is currently in the queue (it’ll be no longer available once the chat was accepted by an agent)

1 Like

thank you so much bro,this solved my problem

1 Like

Hi!

Two cents from me - I think you could find this useful,
calling the visitors endpoint

with state=queued property would give you a list of all queued visitors, chat content is not returned but it contains a variety of useful info.

Kind regards :slight_smile: