Events
During its lifetime, your application will receive events sent from Deskpro. These events can be global events, system or user events or events specific to the host container component.
In addition to classifying them according to their scope and context, events can be classified according to how their handlers are invoked into Request-Response and Fire-And-Forget events:
Request-Response events require their handler to send a response back by invoking a response callback. The Deskpro UI will wait (but not block) for a response from your application and will act according to that. For example, in case of a
'context.ticket.reply'
event if your applications decides to respond with the message{ allowReply: false }
the reply will not go throughFire-And-Forget events do not require a response from your application and are usually sent as notifications that something failed or was successful, for instance an event
'context.ticket.reply-success'
will be sent after the reply is processed on the server-side.
Subscribing to events
In order to receive events, your application must subscribe to them. At the moment the subscription, once acquired can not be cancelled. You use the application client object to subscribe, passing an eventName
and a handler
function:
If you are subscribing to a Request-Response
event then your handler must have the following signature:
If you are subscribing to a Fire-And-Forget
event then your handler must have the following signature:
Ticket Tab Events
These events are available whenever your application runs inside a Ticket UI Tab.
context.ticket.reply
Fired when the Agent clicks the reply button.
Handler invocation type: request-response
Event payload:
Response type:
Usage examples
Disabling ticket replies:
context.ticket.reply-success
Fired after the ticket reply has been successfully processed
Handler invocation type: request-response
Event payload:
context.ticket.update-success
Fired after the server-side has successfully processed a ticket update. This event is triggered whenever a property changes in the Deskpro UI
Handler invocation type: request-response
Event payload:
Last updated