Get notified when agent status is changed

[Problem/Question]
Hi,

We are using SB Desk along with chat JS SDK to have chat capabilities both on our RN and web application.

We would like to present the user a dedicated message when the agent turns to away / offline status.

We are having the following issues:

  1. when using , getOpenTicket api call, the agent property field is missing the agent status , but we managed to overcome it with an api call using our server side that enriches the data.

  2. after a connection is made and the chat is loaded, we do not receive any information on the chat event handlers when the agent changes its status.
    We are using this handler , onMessageReceived, I also registered to onChannelChanged handler but nothing comes through this handler at all.

How can we tackle this issue on real time without reloading all the data from the beginning?

Many thanks
Ronen


// If problem, please fill out the below. If question, please delete.
[SDK Version]
Chat - 3.1.27
Desk - 1.0.22

[Reproduction Steps]
change sendbird desk agent status while in conversation.

[Current impact]
No way to implement this issue on real time.

Hello @Ronen_Meiri ,

You can get notified when the agent status is changed by using webhook services in Sendbird Desk. Webhooks allow you to receive real-time notifications about various events, including agent status changes.

To set up webhook notifications for agent status changes, you need to follow these steps:

  1. Configure your webhook endpoint: Set up a webhook endpoint on your server to receive the notifications. This endpoint should be able to handle HTTP POST requests.

  2. Register the webhook URL: In the Sendbird Dashboard, go to the Desk settings and navigate to the “Webhooks” section. Add your webhook URL to register it with Sendbird Desk.

  3. Define the events to be notified: Specify the events for which you want to receive notifications. In this case, you would select the “Agent Status Change” event.

  4. Handle the webhook notifications: When an agent’s status changes, Sendbird Desk will send a POST request to your webhook endpoint. You can handle this request on your server and perform any necessary actions.

By using webhook services, you can receive real-time notifications when the agent status changes and take appropriate actions based on those notifications.

Hey Rahul,

Thanks for the answer, is it possible to know it in the client side , i.e React Native / React using the sdk ?

You can use the connection event handler provided by the Sendbird SDK to detect changes in the connection status of the client app. When the client app is disconnected from the server, the SDK tries to reconnect to the server and notifies the client app of the result through the connection event handler.

By implementing the connection event handler, you can receive real-time updates on the agent’s status changes without having to reload all the data from the beginning.
You can refer below guide:

Hey Rahul,

Correct if my if I’m wrong, but these event are related to the user who connects to chat via the SDK.

Is this the case with desk agents who change their status?