I’m using SendBird Desk’s JavaScript SDK and ran into a issue. SendBirdDesk.Ticket.getByChannelUrl doesn’t always return the latest status of the Ticket. It’s still returning the same data when the ticket has been closed by the agent.
Is there a way I could get a callback when a certain ticket is opened or closed? The documentation says:
Each event type is located in message.data which looks like below.
You can check out these messages in ChannelHandler.onMessageReceived() .
But I’ve never seen these type values in message.data. The closest things I got were NOTIFICATION_MANUAL_CLOSED and SYSTEM_MESSAGE_TICKET_CLOSED_BY_AGENT. Am I doing something wrong or the documentation is in inaccurate? Also is there a full list of message.data.type values?
But I’ve never seen these type values in message.data . The closest things I got were NOTIFICATION_MANUAL_CLOSED and SYSTEM_MESSAGE_TICKET_CLOSED_BY_AGENT
Yes. You can get the event type from the json data in message.data. I will share all of the system message types on the above notion link later.
{
“custom_type”: “”,
“mentioned_users”: ,
“updated_at”: 0,
“is_removed”: false,
“type”: “ADMM”,
“message”: “Hi, how can I help you?”,
“data”: “{"type": "NOTIFICATION_WELCOME"}”,
“mention_type”: “users”,
“created_at”: 1582181294246,
“channel_url”: “sendbird_group_channel_7444658_46427cc7ff1f8ce0f82529b6de8072199c8562ff”,
“message_id”: 15084827
},
This topic is 1 and half year old, but I came to the same situation. I don’t understand how should I handle if a ticket is closed. Even the Sendbird Desk for JavaScript sample doesn’t handle if an agent closes a ticket. But we need to delete a closed ticket from the opened ticket list.
As I “debugged” until now, I get 2 events in onMessageReceived (which relevant props are):