Interaction APIs

MXOAction

Actions are the objects, or containers, that hold the messages, marketing content, agent scripts, app alerts, and so on that you want to present to visitors to customers to your Touchpoints. Actions are the things that MXO does in order to affect the customer's experience. MXO provides both online and offline Actions.

open class MXOAction : NSObject {
	open var name: String? { get }
	open var asset: MXOAsset? { get }
	open var proposition: MXOProposition? { get }
}
PropertyTypeDescription
nameString?The name of the Action.
assetMXOAsset?The Asset for this Action.
propositionMXOProposition?The optional Proposition for this Action.
Note: For more information, see how to retrieve an Interaction response.

MXOAsset

Assets are the content, or bundles of content, that are delivered to the customer via an MXO Action. Assets can be graphics, HTML files, XML, text, or external Assets that are available for display.

open class MXOAsset : NSObject {
	open var markup: String? { get }
	open var mimeType: MXOMimeType { get }
	open var responses: [MXOAssetResponse]? { get }
	open var contentUrl: String? { get }
}
PropertyTypeDescription
markupString?The language markup for presenting the Asset.
responses[MXOAssetResponse]?The optional responses for informing MXO of a user Interaction with the Asset.
mimeTypeMXOMimeTypeThe markup language type.
contentUrlString?A remote location the Asset represents.
Note: For more information, see how to retrieve an Interaction response.

MXOAssetResponse

MXO Assets response for tracking.

open class MXOAssetResponse : NSObject {
	open var code: MXOResponseCode? { get }
	open var sentiment: MXOAssetResponseSentiment { get }
	open var label: String? { get }
	open var imageUrl: String? { get }
	open var targetUrl: String? { get }
	open var target: MXOAssetResponseTarget { get }
}
PropertyTypeDescription
codeMXOResponseCode?The code to send to MXO when an Asset is responded to.
sentimentMXOAssetResponseSentimentThe type of response to track.
labelString?The label to show if desired.
imageUrlString?The image to load if desired.
targetUrlString?The target URL to load if desired.
targetMXOAssetResponseTargetThe location the sentiment should send the user.
Note: For more information, see how to retrieve an Interaction response.

MXOAssetResponseSentiment

This is how a user responded to an MXO Asset response.

public enum MXOAssetResponseSentiment : Int, @unchecked Sendable {
	case positive = 0
	case neutral = 1
	case negative = 2
	case unknown = 3
}
EnumDescription
positiveThe positive tap on an Asset.
neutralThe Asset is dismissed or ignored.
negativeThe Asset is rejected.
unknownUnknown response.
Note: For more information, see how to retrieve an Interaction response.

MXOAssetResponseTarget

The location of an MXO Asset response.

public enum MXOAssetResponseTarget : Int, @unchecked Sendable {
	case in_app = 0
	case external = 1
	case context = 2
	case unknown = 3
}
EnumDescription
in_appThe Asset is targeted to the same app.
externalThe Asset is targeted to an external URL.
contextThe Asset is targeted to an Action context.
unknownUnknown response.
Note: For more information, see how to retrieve an Interaction response.

MXOCaptureActivityPoint

Capture user Activity when they interact with an MXO Interaction.

open class MXOCaptureActivityPoint : NSObject {
	open var identifier: String? { get }
	open var path: String? { get }
}
PropertyTypeDescription
identifierString?The internal MXO id of the point.
pathString?The location of Activity to capture, such as a button click.
Note: For more information, see how to retrieve an Interaction response.

MXOCaptureAttributePoint

Capture user Attribute when they interact with an MXO Interaction.
open class MXOCaptureAttributePoint : NSObject {
	open var identifier: String? { get }
	open var path: String? { get }
	open var elementType: MXOCaptureElementType { get }
	open var elementName: String? { get }
	open var elementAttributeName: String? { get }
	open var captureDelay: Int { get }
	open var captureType: MXOCaptureType { get }
	open var capturePhase: MXOCapturePhase { get }
}
PropertyTypeDescription
identifierString?The internal MXO id of the point.
pathString?The location of Attribute to capture, such as a button click.
elementTypeMXOCaptureElementTypeThe type of the element.
elementNameString?The name of the element.
elementAttributeNameString?The name of the element Attribute to capture.
captureDelayIntHow long to wait to capture the value.
captureTypeMXOCaptureTypeThe type of capture.
capturePhaseMXOCapturePhaseThe lifecycle time to capture the value.
Note: For more information, see how to retrieve an Interaction response.

MXOCaptureElementType

The type of an element.

public enum MXOCaptureElementType : Int, @unchecked Sendable {
	case textfield = 0
	case checkbox_radio = 1
	case display_elem = 2
	case drop_down = 3
	case unknown = 4
}
EnumDescription
textfieldInput value for the text or search field.
checkbox_radioInput value for the selected checkbox/radio button.
display_elemDisplay value for the selected display element.
drop_downInput value for the selected dropdown list.
unknownThe unknown Attribute capture element type.
Note: For more information, see how to retrieve an Interaction response.

MXOCapturePhase

The phase in which to capture an Attribute.

public enum MXOCapturePhase : Int, @unchecked Sendable {
	case phase_load = 0
	case on_click = 1
	case parameter = 2
	case unknown = 3
}
EnumDescription
phase_loadThe Attribute is captured whenever a page is loaded.
on_clickThe Attribute is captured once clicked or tapped.
parameterThe Attribute is captured for a query parameter.
unknownThe unknown Attribute capture phase.
Note: For more information, see how to retrieve an Interaction response.

MXOCaptureType

The type of value to capture from an element.

public enum MXOCaptureType : Int, @unchecked Sendable {
	case attribute = 0
	case text = 1
	case value = 2
	case cookie = 3
	case unknown = 4
}
EnumDescription
attributeName of the Attribute.
textCaptures a text.
valueCaptures a Boolean value.
cookieCaptures data from a cookie on the current page.
unknownThe unknown Attribute capture type.
Note: For more information, see how to retrieve an Interaction response.

MXOInteraction

Interactions are the key elements of the customer experience, representing the ongoing conversation between your customer and your organization at any of your Touchpoints. Interaction Points let you to capture customer Activity, capture customer input, and return optimized content to your customer during those interactions.

In a mobile app, an Interaction Point represents an individual screen or context.

open class MXOInteraction : NSObject {
	open var value: URL? { get }
}
PropertyTypeDescription
valueURL?The UIR representation of the Interaction.
Note: For more information, see how to retrieve an Interaction response.

MXOIntractionRequest

The Interaction request object for sending interaction data from the MXO SDK.

open class MXOInteractionRequest {
	open var interaction: MXOInteraction? { get }
    	open var properties: [String : String]? { get }
	open var onError: MXORequestOnErrorBlock? { get }
	open var onSuccess: MXORequestOnSuccessBlock? { get }
}
PropertyTypeDescription
interactionMXOInteraction?The Interaction to be sent to MXO.
properties[String : String]?Properties map to be sent with the Interaction.
onErrorMXORequestOnErrorBlock?Provide an MXO Error handler.
onSuccessMXORequestOnSuccessBlock?Provide an MXO Interaction response.

Create an instance using the Builder as shown below:

let interactionRequest = MXOInteractionRequest { builder in
	builder.interaction = MXOInteraction(withString: "")
	builder.properties = ["name": @"value"];
	builder.onError = {
		// process error
	}
        builder.onSuccess = {
		// process response
	}
}
Note: For more information, see how to retrieve an Interaction response.

MXOIntractionResponse

MXO Interaction response data.

open class MXOInteractionResponse : NSObject {
	open var interaction: MXOInteraction? { get }
	open var tid: String? { get }
	open var optimizationPoints: [MXOOptimizationPoint]? { get }
	open var captureAttributePoints: [MXOCaptureAttributePoint]? { get }
	open var captureActivityPoints: [MXOCaptureActivityPoint]? { get }
}
PropertyTypeDescription
interactionMXOInteraction?The interaction this response is for.
tidString?The unique id for this user's interaction.
optimizationPoints[MXOOptimizationPoint]?The MXO Interaction Response for Optimization Points.
captureActivityPoints[MXOCaptureActivityPoint]?The MXO Interaction Response for Activity Points.
captureAttributePoints[MXOCaptureAttributePoint]?The MXO Interaction Response for Attribute Points.
Note: For more information, see how to retrieve an Interaction response.

MXOMimeType

Possible types of MXO Assets.

public enum MXOMimeType : Int, @unchecked Sendable {
	case json = 0
	case txt = 1
	case html = 2
	case xml = 3
	case external = 4
	case unknown = 5
}
EnumDescription
jsonThe Asset of a json type.
txtThe Asset of a text type.
htmlThe Asset of a html type.
xmlThe Asset of a xml type.
externalThe Asset of a external type.
unknownUnknown Asset type.
Note: For more information, see how to retrieve an Interaction response.

MXOOptimizationPoint

MXO Interaction response data.

open class MXOOptimizationPoint : NSObject {
	open var path: String? { get }
	open var actions: [MXOAction]? { get }
	open var directives: MXOOptimizationPointDirectives { get }
}
PropertyTypeDescription
pathString?The location to optimize.
actions[MXOAction]?The set of MXO Actions available to take for the Optimization.
directivesMXOOptimizationPointDirectivesThe position of the Optimization.
Note: For more information, see how to retrieve an Interaction response.

MXOOptimizationPointDirectives

The position to place an Optimization.

public enum MXOOptimizationPointDirectives : Int, @unchecked Sendable {
	case replace = 0
	case before = 1
	case after = 2
	case unknown = 3
}
EnumDescription
replaceThe Asset replaces the content area.
beforeThe Asset is inserted before the content area.
afterThe Asset is inserted after the content area.
unknownThe unknown directives for the Asset.
Note: For more information, see how to retrieve an Interaction response.

MXOProposition

Propositions are the products or services that you want to promote to customers. For example, a 0% balance transfer offer on credit cards.

Use Propositions to set up the long-term and short-term campaigns, offers, invitations, and parent-child hierarchies to use for your marketing initiatives.

open class MXOProposition : NSObject {
	open var name: String? { get }
	open var code: String? { get }
	open var type: MXOPropositionType { get }
}
PropertyTypeDescription
nameString?The proposition name.
codeString?The business code associated with the proposition.
typeMXOPropositionTypeThe type of proposition.
Note: For more information, see how to retrieve an Interaction response.

MXOPropositionType

The type of a proposition.

Products are typically items you can see and touch, such as computers, cars (or any of the parts of a car), credit cards, car insurance, mobile phones, and so on.

Services are typically provided for you by other people, such as customer service, support, and so on.

Products and services can have parent-child relationships. For example, a product such as a credit card might have other products nested below it, such as different credit card types like platinum, gold, silver, and prepaid.

public enum MXOPropositionType : Int, @unchecked Sendable {
	case product = 0
	case service = 1
}
EnumDescription
productThe product Proposition.
serviceThe service Proposition.
Note: For more information, see how to retrieve an Interaction response.

MXORequestOnErrorBlock

The MXO request sent on error.

public typealias MXORequestOnErrorBlock = (
	Error
) -> Void
Note: For more information, see how to retrieve an Interaction response.

MXORequestOnSuccessBlock

The MXO request sent on success.

public typealias MXORequestOnSuccessBlock = (
	MXOInteractionResponse
) -> Void
Note: For more information, see how to retrieve an Interaction response.

MXOResponseCode

The response code object containing the response code value. This is used as part of the MXOResponseCodeRequest object. Response code values is sent to the MXO API as a property value.

open class MXOResponseCode : NSObject {
    	open var value: String?
}
PropertyTypeDescription
valueString?The response code string value.
Note: For more information, see how to send a response code.

MXOResponseCodeRequest

The response code request object for sending the response code to the MXO SDK.

open class MXOResponseCodeRequest {
	open var interaction: MXOInteraction? { get }
	open var responseCode: MXOResponseCode? { get }
	open var onError: MXORequestOnErrorBlock? { get }
	open var onSuccess: MXORequestOnSuccessBlock? { get }
}
PropertyTypeDescription
interactionMXOInteractionThe URI value containing the Interaction path.
responseCodeMXOResponseCodeResponse code object containing the response code value.
onErrorMXORequestOnErrorBlockProvide an MXO error handler.
onSuccesMXORequestOnSuccessBlockProvide an MXO Interaction response.

Create an instance using the Builder as shown below:

let responseCode = MXOResponseCodeRequest { builder in
	builder.interaction = MXOInteraction(withString: "")
	builder.responseCode = MXOResponseCode(withResponseCode: responseCode)
	builder.onError = {
		// process error 
	}
	builder.onSuccess = {
		// process response
	}
}
Note: For more information, see how to send a response code.