sendInteractionResponseCode
Sending an Interaction response code can be useful when displaying Optimizations programmatically and capturing the user's response.
sendInteractionResponseCode(request: MXOResponseCodeRequest | null): Promise<MXOResult<MXOInteractionResponse>>
Example of usage:
// Assumes the Interaction response code came from the response from using the sendInteraction
API
const interactionResponse = {
interaction : 'capacitor://touchpoint/interaction',
responseCode : '9IJHB567HGDDS93DGJBVFSSE88711RKJHRFDSS'
}
MedalliaMXO.sendInteractionResponseCode(interactionResponse)
.then(mxoResult => {
if (mxoResult.value && mxoResult.value.apiName) {
// error case
console.error(mxoResult.value)
} else {
// success case
console.log("The response code is sent: ", mxoResult.value)
}
})
.catch(error => {
console.error(error)
})
try {
// Assumes the Interaction response code came from the response from using the sendInteraction API
const interactionResponse : MXOResponseCodeRequest = {
interaction : 'capacitor://touchpoint/interaction',
responseCode : '9IJHB567HGDDS93DGJBVFSSE88711RKJHRFDSS'
}
const {value} = await MedalliaMXO.sendInteractionResponseCode(interactionResponse)
if (value && value.apiName) {
// error case
console.error(value)
} else {
// success case
console.log("The response code is sent: ", value)
}
} catch (error) {
console.error(error)
}
capacitor://touchpoint/interaction
.