Cisco Unity Connection Notification Interface (CUNI) API -- Subscribing to and Processing Notification Events

From DocWiki

(Difference between revisions)
Jump to: navigation, search
m (1 revision)

Revision as of 00:05, 14 December 2010

Links to Other API pages: Cisco_Unity_Connection_APIs

CUNI Guide Contents
API Overview
CUNI Event Schema
Subscribing to and Processing Notification Events


Subscribing to Notification Events

Subscribing to notification events is done through the web service interface, and can be as simple as a single web service call to "subscribe".

At a minimum you should pass in:

  • The callback URL where XML notifications will be posted by the Notifier
  • The date/time when the subscription will expire

It is also possible to pass in a list of the resources (userid) that you are interested in receiving events for, although that can also be done via a subsequent call to "addResourceIdToSubscription". We recommend that you leave the eventTypeList empty, indicating that you would like to receive all types of message events.

This example shows making a call to subscribe in Java, using Axis2 stubs generated from the WSDL:

Calendar expiration = java.util.Calendar.getInstance(); s = 

// Set subscription expiry to two months from now.
expiration.add(Calendar.MONTH, 2); 

// Specify the users we're interested in, which is just the operator for this example.
ArrayOfString resourceList = new ArrayOfString(); 


// Set the callback information - a username and password can be specified, but they are optional.
MessageEventServiceStub.CallbackServiceInfo c = new MessageEventServiceStub.CallbackServiceInfo(); 

// Subscribe! 
SubscribeResponse r = stub.subscribe(s); 

Processing Notification Events

Events will be delivered via HTTP POST to the callback URL that was provided in the call to subscribe.

There are four basic types of events:

Event Type Description
NEW_MESSAGE Sent when a new message arrives in a user Inbox.
SAVED_MESSAGE Sent when a message is marked as read.
UNREAD_MESSAGE Sent when a message is marked as unread.
DELETED_MESSAGE Sent when a message is deleted. (Note that this is sent on either a "hard" or "soft" delete. In the case of a soft delete, when the message is deleted from the deleted items list, no further event is sent out.)


This is an example of an event xml. Keep in mind that it is valid to have more than one messageInfo per messageEvent:

<?xml version="1.0" ?>
<messageEvent subscriptionId="00bdcfd3-159a-48d3-ac7b-2f3b4f83db6c"
              eventTime="11:15:40 PM 10/30/2008" 
              displayName="Alexander Bell" 
    <messageInfo messageId="72204bd7-e5c3-446e-adb6-ae5f80db26fb"
                 receiveTime="04:15:40 PM 10/30/2008" 
                 callerAni="null" />

Rating: 5.0/5 (1 vote cast)

Personal tools