sendInteraction
Programmatic Interactions can be sent to only a preconfigured Interaction path and with defined Properties.
sendInteraction(request: MXOInteractionRequest): Promise<MXOResult<MXOInteractionResponse>>
Example of usage:
const interactionRequest = {
interaction : 'capacitor://touchpoint/interaction',
properties : {
'key1':'value1',
'key2':'value2'
}
}
MedalliaMXO.sendInteraction(interactionRequest)
.then(mxoResult => {
if (mxoResult.value && mxoResult.value.apiName) {
// error case
console.error(mxoResult.value)
} else {
// success case
console.log("The Interaction response is sent: ", mxoResult.value)
}
})
.catch(error => {
console.error(error)
})
try {
const interactionRequest : MXOInteractionRequest = {
interaction : 'capacitor://touchpoint/interaction',
properties : {
'key1':'value1',
'key2':'value2'
}
}
const {value} = await MedalliaMXO.sendInteraction(interactionRequest)
if (value && value.apiName) {
// error case
console.error(value)
} else {
// success case
console.log("The Interaction response is sent: ", value)
}
} catch (error) {
console.error(error)
}
capacitor://touchpoint/interaction
.