Is there a Javascript API method for receiving messages? Something like: Intercom('onMessageReceived', function(){ //Do stuff... } | Community
Skip to main content
Answered

Is there a Javascript API method for receiving messages? Something like: Intercom('onMessageReceived', function(){ //Do stuff... }

  • February 23, 2023
  • 1 reply
  • 85 views

Basically when the messenger is closed and the user receives a message via the borderless frame I want to trigger a function. 

 

Thanks

Best answer by Daniel M15

Hey @user1434​! Daniel from Customer Support Engineering here 🔧 

 

We don't specifically have a way to track if the Messenger is in a closed state, but you might find the conversation.admin.replied webhook useful to you. This will allow you to perform an action whenever an admin sends a reply to your users, or it can be just useful for returning a conversation model at the instance of the reply.

 

Hope it helps! 😁

1 reply

Daniel M15
Employee
  • Employee
  • Answer
  • February 27, 2023

Hey @user1434​! Daniel from Customer Support Engineering here 🔧 

 

We don't specifically have a way to track if the Messenger is in a closed state, but you might find the conversation.admin.replied webhook useful to you. This will allow you to perform an action whenever an admin sends a reply to your users, or it can be just useful for returning a conversation model at the instance of the reply.

 

Hope it helps! 😁