1.7 KiB
1.7 KiB
IVA Studio Workspace
Place to put random files and examples used in IVA Workspaces
Channel Automation
Interaction Notification API
Interaction Notification API is used to push Call Pops into Channel Automation.
Prerequisits
- Install and configure the Channel Automation Interface Package from Resource Center -> Hub.
- Download then Import INAPI Package
Source Code
INAPI Global Variable Function
Example Usage
Conversation Flow Code Block that calls the API with some data and user name 'ccmary'
(async () => {
const ani = recognizedObject.metadata.ani;
const dnis = recognizedObject.metadata.dnis;
const firstName = conversationData.customer?.firstName ?? "FirstName";
const lastName = conversationData.customer?.lastName ?? "LastName";
const studentId = conversationData.customer?.studentId ?? "StudentId";
const dob = conversationData.customer?.dob ?? "1/1/1970";
INAPI().post(`${ani}`, `${dnis}`, "ccmary", {
"@type": "ved:TelephonyCallDataED",
"ved:firstName": `${firstName}`,
"ved:lastName": `${lastName}`,
"ved:studentId": `${studentId}`,
"ved:dob": `${dob}`,
});
})()
.catch((error) => {
console.log(error.message);
recognizedObject.answers.push("");
recognizedObject.errorInfo = {
...recognizedObject.errorInfo,
label: {
data: error.toJSON ? error.toJSON() : {},
message: error.message,
},
};
})
.finally(() => {
next();
});