Sending Interactions to MXO
Programmatic Interactions can be sent to only a preconfigured Interaction path and with defined Properties.
See in the examples below how you can send an Interaction request, Interaction request with Properties, and how to retrieve responses for those requests.
/
and only contains letters, numbers and/or dashes.Sending an Interaction request
Send an Interaction request programmatically by calling the sendInteraction
method and passing an Interaction path as a parameter as shown below:
const interactionRequest = {
interaction: 'cordova://app-test/interaction1'
}
MedalliaMXO.sendInteraction(interactionRequest).then(() => {
// do something after the interaction gets sent
})
.catch((error) => {
// do something with the error
console.error(error)
})
This sends a POST request to Medallia Experience Orchestration. Only the TID from the response is used by the SDK; all other response objects are ignored.
Sending an Interaction request and retrieve the response
Send an Interaction request programmatically and retrieve its response by passing an Interaction path and a completion block as a parameters, as shown below:
const interactionRequest = {
interaction: 'cordova://app-test/interaction1'
}
MedalliaMXO.sendInteraction(interactionRequest).then((response) => {
// do something after the interaction gets sent
// process response
return MedalliaMXO.processResponse(response)
})
.catch((error) => {
// do something with the error
console.error(error)
})
This sends a POST request to Medallia Experience Orchestration. This method returns the response to the SDK to process attaching any capture, track or optimize instructions to the Interaction.
Sending an Interaction request with Properties
Send an Interaction request with Properties by calling the method below, passing an Interaction path and dictionary of defined Properties to it:
const interactionRequest = {
interaction: 'cordova://app-test/interaction1',
properties: {
key1: 'value1',
key2: 'value2'
}
}
MedalliaMXO.sendInteraction(interactionRequest).then(() => {
// do something after the interaction gets sent
})
.catch((error) => {
// do something with the error
console.error(error)
})
This sends a POST request to Medallia Experience Orchestration. Only the tid from the response is used by the SDK; all other response objects will be ignored.
Sending an Interaction request with Properties and retrieve the response
Send an Interaction request with Properties and retrieve its response by calling the method below, passing an Interaction path, dictionary of defined Properties, and a completion block to it:
const interactionRequest = {
interaction: 'cordova://app-test/interaction1',
properties: {
key1: 'value1',
key2: 'value2'
}
}
MedalliaMXO.sendInteraction(interactionRequest).then((response) => {
// do something after the interaction gets sent
// process response
return MedalliaMXO.processResponse(response)
})
.catch((error) => {
// do something with error
console.error(error)
})
This sends a POST request to Medallia Experience Orchestration. This method returns the response to the SDK to process, attaching any capture, track or optimize instructions to the Interaction.