Introduction
When a project uses a CCaaS provider such as Genesys or NICE inContact, the end results of the Omilia part of the interaction are collected in an object called miniAppResult. All the information collected in this object is then passed from the OCP back to the CCaaS through the the session-handling API and adds the miniAppResult data in the session. From there they can be parsed and used in numerous ways such as routing decisions, agent screens population, data dips, reporting, and so on. Omilia's standard telephony integration for all the supported CCaaS providers includes scripts that parse the miniAppResult.
-
Implementations in Talkdesk, such as direct SIP integrations, do not require a
miniAppResultobject to return to the CCaaS provider. Use the Transfer block of Orchestrator instead. -
Implementations without a CCaaS provider and with direct SIP integration do not use the
miniAppResultobject.
miniApp implementations
For standalone miniApp implementations, the miniAppResult is set by the miniApp and cannot be modified. Use a CCaaS script to read the miniAppResult for proper call handling.
During a dialog session, each miniApp produces an output returned in the miniAppResult field. Below are its possible keys with brief descriptions.
|
Key name |
Description |
|
|
All user utterances. |
|
|
DiaManT dialog ID. |
|
|
The call duration in milliseconds. |
|
|
Indicates the result of the miniApp.
This key depends directly on the |
|
|
The dialog step. |
|
|
Stores the result value of the miniApp validation.
|
|
|
Name of the validation that succeeded. |
|
|
Name of the validation that failed. |
|
|
Reason the validation failed. |
|
|
Number of wrong inputs. |
|
|
miniApp application ID. |
|
|
miniApp request ID. |
|
|
Call start timestamp. |
|
|
The locale of the miniApp at runtime. |
|
|
Number of agent requests. |
|
|
Count of |
|
|
Count of |
|
|
Count of global errors. |
|
|
The reason the miniApp failed is described in the article Fail Exit Reason, which lists all possible values for |
|
|
Caller requests for the miniApp to close.
|
|
|
The last DTMF value provided from the caller during an Intent type miniApp. |
|
|
The value that the miniApp got from user (for example, in Alphanumeric the value could be abc123 , however in a Date miniApp the value could be 20/02/1990). |
Orchestrator implementations
For Orchestrator implementations, the miniAppResult should be created by an Intelli miniApp. This Intelli should have as input the data required to build the miniAppResult and as output the miniAppResult field. This field’s value should be a JSON object that contains all the information that should be passed to the next system. The Intelli that creates the miniAppResult should be added as:
-
the last block before the end of a call termination (transfer or system hangup)
-
the last block of the error handling flow(s)
Basic miniAppResult structure
When creating the miniAppResult JSON object for an Orchestrator application, the following elements are mandatory:
|
Element |
Description |
|---|---|
|
|
Possible values: success or fail.
Set the |
|
|
Possible values: true or false.
|
|
|
Extra data that the CCaaS script should read delimited by pound |
Sample JS
Below is some sample code that you can use to bootstrap your Intelli miniApp. It assumes as inputs:
-
Two fields to populate an agent screen (
myField1andmyField2) -
failExitReasonas last set by the orchestrator application
The output is the miniAppResult JSON object. The Intelli miniApp that uses this sample code is the last one used before a transfer.
The following JS sample code is used as a function at the Output tab of the Intelli miniApp.
var closeFlag = "false";
try {
var Inputs = {
myField1: params.orchestratorInput1, // set orchestratorInput1 as miniApp input in your Orchestrator canvas
myField2: params.orchestratorInput2, // set orchestratorInput2 as miniApp input in your Orchestrator canvas
failExitReason: params.FailExitReason // set FailExitReason as miniApp input in your Orchestrator canvas
}
} catch (err) {
console.log("An error occured.");
var Inputs = {
myField1: "unknown",
myField2: "unknown",
failExitReason: "unknown"
};
}
var miniAppResult = {
result: "success",
closing_request_flag: closeFlag,
fail_exit_reason: Inputs.FailExitReason,
"input_value": (
"myField1:" + Inputs.myField1 + "#" +
"myField2:" + Inputs.myField2)
};
var Outputs = {
output1: miniAppResult, // set miniAppResult as miniApp output in your Orchestrator canvas
output2: closeFlag // set closeFlag as miniApp output in your Orchestrator canvas
};
Outputs;
When it comes to using the Orchestrator to parse the miniAppResult as an output of the Intelli miniApp, always use the output1/output2 notation as per the screenshot below.
miniAppResult implementation best practices
Do not have spaces at the field value.
Do not create an Object-inside-an-Object. The Connector supports only a single-level depth object.
miniAppResult in Dialog End Event Handlers
-
When you use a Dialog End Event Handler to populate the
miniAppResult, enable the Send data Before Session Close toggle to create yourminiAppResultbefore passing the callback to the CCaaS provider.
-
After creating your Event Handler, click Deploy all.
-
The root Flow does not log the
miniAppResultwhen it is created with an on Dialog End Event Handler. However, you should have available the Intelli output, if no encryption or masking is imposed. -
Review the respective Orchestrator’s documentation for Event Handlers.
When to create the miniAppResult
The miniAppResult must be generated at the conclusion of the OCP session, specifically within the scope of a Dialog End Handler.
Dialog Event Handlers execute when a Dialog End event triggers, such as NEAR_HUP, FAR_HUP, or TRANSFER, before control passes to the CCaaS provider script.
From a technical perspective, an Intelli miniApp should be employed to create and populate the miniAppResult JSON object, embedding the required dataset to be transmitted to the CCaaS provider.
Advanced topics
What happens in the background (Orchestrator implementations)
The miniAppResult involves the OCP dialog manager passing the JSON object to the CCaaS-specific Connector, which then sends it to the CCaaS provider.