Feedback

  • Contents
 

dialer.subscribeToCustomHandlerNotification Method

Definition

This hook allows a custom script to asynchronously subscribe and listen to a Send custom notification step in a custom handler. To do this, call the subscribeToCustomHandlerNotification method from a static dialer object.

NOTE: This functionality is only available in Interaction Connect. It is not available in Scripter .NET.

Input Parameters

headers

The scripter has to define the header containing the objectID, eventID pairs that they want to subscribe to. For example:

var headers = [
  { "objectId": "CompletePurchaseObjectID", "eventId": "CompletePurchaseEventID" },
  { "objectId": "NextTransactionObjectID", "eventId": "NextTransactionEventID" }
];
responseCallBackHandler

This is a user-defined function that is called upon the reception of a notification from the custom handler. This function accepts three parameters: objectId, eventId and data. For example:

function executeWhenHandlerResponds(objectId, eventId, data)
{ console.log('ObjectID returned was: '+ objectId); console.log('EventID returned was: '+ eventId); console.log('DataReturned was '+ data); }

The user can parse the data object returned as they wish. However, they should be able to anticipate the type of data the notification contains which requires knowledge of the custom handler's steps.

Value Returned

There is no return value.

NOTE: Upon subscription to the SendCustomNotification step, a script may initiate custom handlers through the sendCustomHandlerNotification from the static dialer object. See dialer.sendCustomHandlerNotification Method.