cancelEvent (JavaScript API Reference) for Dynamics 365 Channel Integration Framework 2.0
Cancels the notification about incoming conversations based on the cancellation token.
Syntax
Microsoft.CIFramework.cancelEvent(cancellationToken, correlationId).then(successCallback, errorCallback);
Parameters
Name | Type | Required | Description |
---|---|---|---|
cancellationToken | String | Yes | Unique string that was provided in the notifyEvent method to display notifications about incoming conversations. |
correlationId | GUID | No | Used to group all related API calls together for diagnostic telemetry. |
successCallback | Function | No | A function to call when the request is successful. On successful callback, the response object will contain the cancellation token. |
errorCallback | Function | No | A function to call when the request fails. |
Callback function details
The following objects are passed into the successCallback
and errorCallback
functions.
successCallback function
Returns the cancellation token.
errorCallback function
Sample JSON object:
{
"message" : "<error details>",
"msdyn_name" : "CancelEvent"
}
Parameters
message | Description |
---|---|
RejectAfterClientError | An unknown exception occurred (occurs when the Platform API call fails or some input parameter is missing) |
Example
// Trying to cancel a notification, use the same cancelToken passed during creation of notification in notifyEvent
Microsoft.CIFramework.cancelEvent(CancelToken).then(
function success(result) {
console.log(result);
// Perform operations
},
function (error) {
console.log(error.message);
// Handle error conditions
}
);