How do you subscribe to Finesse Notifications?
Users are automatically subscribed to some of the notification feeds such as:
- User - /finesse/api/User/{id}
- Dialogs - /finesse/api/User/{id}/Dialogs
- SystemInfo - /finesse/api/SystemInfo
This means that when a connection to the Finesse Notification Service is made for a particular user, notifications sent to those nodes will automatically be sent to the user. An explicit subscription is not needed.
To receive notifications for feeds to which they are not automatically subscribed, clients must explicitly subscribe to the node on which the notifications are published. In order to do so, the client must send a IQ message to the XMPP session for the node that the user would like to subscribe to.
The following example shows how to subscribe to agent state change notifications for a specific team:
<iq type='set'
from='CharlesNorrad@finesse-server.cisco.com'
to='pubsub.finesse-server.cisco.com'
id='sub1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<subscribe
node='/finesse/api/Team/1000/Users'
jid='ChuckieNorrad@finesse-server.cisco.com'/>
</pubsub>
</iq>
The following example shows how to unsubscribe to agent state change notifications for a specific team:
<iq type='set'
from='CharlesNorrad@finesse-server.cisco.com'
to='pubsub.finesse-server.cisco.com'
id='unsub1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<unsubscribe
node='/finesse/api/Team/1000/Users'
jid='CharlesNorrad@finesse-server.cisco.com'/>
</pubsub>
</iq>
In the above two iq examples:
- CharlesNorrad is the user's agentId
- finesse-server.cisco.com is the Finesse server's FQDN
- 1000 is the teamId the user is subscribing to
For more details, take a look at the Subscription Management section of the Finesse Developer Guide.
Comments
0 comments
Please sign in to leave a comment.