Skip to main content
POST
/
Agent
/
Xmpp
/
RegisterEventHandler
Register Event Handler
curl --request POST \
  --url https://{host}/Agent/Xmpp/RegisterEventHandler \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "tabId": "<string>",
  "localName": "<string>",
  "namespace": "<string>",
  "type": "<string>",
  "function": "<string>"
}
'
{}

Overview

Registers (or unregisters) an event handler on the client, that gets called when the account receives an XMPP message of a given type. When such a message is received that matches a registered event handler, the message is pushed as a client event to the client, instead of being stored on the broker, as an offline message. Note: For client events to be received on the client, you need to include the /Events.js javascript file on the page. This javascript file will register the current tab with the server, and enable it to receive asynchronous events from the server. If you are hosting the page on one server, and use the Agent API and Events API from another server, you need to include a meta header on the page, information the /Events.js javascript file where it will register itself to receive client events. To use this neuron, add the following to the HTML header of your page: You also need to inform the AgentAPI that you want to use another host, than the server used to host the page. You do this by making a call to AgentAPI.IO.SetHost(Host,Secure) as follows:

Authentication

Requires a valid JWT bearer token.

Notes

This endpoint uses the request schema notation described in Pattern matching.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
tabId
string
required
localName
string
namespace
string
type
string
function
string

Response

200 - application/json

Success

The response is of type object.