sendInteraction

Programmatic Interactions can be sent to only a preconfigured Interaction path and with defined Properties.

Important: The CapacitorJS SDK does not send programmatic Interactions if there is no associated Activity Capture, Attribute Capture or Optimization Point added for them.
Send an Interaction request by calling the following:
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)
}
Tip: When sending Interaction requests programmatically, ensure the interaction is a fully qualified URI, containing the scheme, authority, and path. For example, capacitor://touchpoint/interaction.