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 }
}
Property | Type | Description |
---|---|---|
name | String? | The name of the Action. |
asset | MXOAsset? | The Asset for this Action. |
proposition | MXOProposition? | The optional Proposition for this Action. |
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 }
}
Property | Type | Description |
---|---|---|
markup | String? | The language markup for presenting the Asset. |
responses | [MXOAssetResponse]? | The optional responses for informing MXO of a user Interaction with the Asset. |
mimeType | MXOMimeType | The markup language type. |
contentUrl | String? | A remote location the Asset represents. |
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 }
}
Property | Type | Description |
---|---|---|
code | MXOResponseCode? | The code to send to MXO when an Asset is responded to. |
sentiment | MXOAssetResponseSentiment | The type of response to track. |
label | String? | The label to show if desired. |
imageUrl | String? | The image to load if desired. |
targetUrl | String? | The target URL to load if desired. |
target | MXOAssetResponseTarget | The location the sentiment should send the user. |
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
}
Enum | Description |
---|---|
positive | The positive tap on an Asset. |
neutral | The Asset is dismissed or ignored. |
negative | The Asset is rejected. |
unknown | Unknown 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
}
Enum | Description |
---|---|
in_app | The Asset is targeted to the same app. |
external | The Asset is targeted to an external URL. |
context | The Asset is targeted to an Action context. |
unknown | Unknown 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 }
}
Property | Type | Description |
---|---|---|
identifier | String? | The internal MXO id of the point. |
path | String? | The location of Activity to capture, such as a button click. |
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 }
}
Property | Type | Description |
---|---|---|
identifier | String? | The internal MXO id of the point. |
path | String? | The location of Attribute to capture, such as a button click. |
elementType | MXOCaptureElementType | The type of the element. |
elementName | String? | The name of the element. |
elementAttributeName | String? | The name of the element Attribute to capture. |
captureDelay | Int | How long to wait to capture the value. |
captureType | MXOCaptureType | The type of capture. |
capturePhase | MXOCapturePhase | The lifecycle time to capture the value. |
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
}
Enum | Description |
---|---|
textfield | Input value for the text or search field. |
checkbox_radio | Input value for the selected checkbox/radio button. |
display_elem | Display value for the selected display element. |
drop_down | Input value for the selected dropdown list. |
unknown | The unknown Attribute capture element type. |
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
}
Enum | Description |
---|---|
phase_load | The Attribute is captured whenever a page is loaded. |
on_click | The Attribute is captured once clicked or tapped. |
parameter | The Attribute is captured for a query parameter. |
unknown | The unknown Attribute capture phase. |
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
}
Enum | Description |
---|---|
attribute | Name of the Attribute. |
text | Captures a text. |
value | Captures a Boolean value. |
cookie | Captures data from a cookie on the current page. |
unknown | The unknown Attribute capture type. |
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 }
}
Property | Type | Description |
---|---|---|
value | URL? | The UIR representation of the Interaction. |
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 }
}
Property | Type | Description |
---|---|---|
interaction | MXOInteraction? | The Interaction to be sent to MXO. |
properties | [String : String]? | Properties map to be sent with the Interaction. |
onError | MXORequestOnErrorBlock? | Provide an MXO Error handler. |
onSuccess | MXORequestOnSuccessBlock? | 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
}
}
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 }
}
Property | Type | Description |
---|---|---|
interaction | MXOInteraction? | The interaction this response is for. |
tid | String? | 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. |
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
}
Enum | Description |
---|---|
json | The Asset of a json type. |
txt | The Asset of a text type. |
html | The Asset of a html type. |
xml | The Asset of a xml type. |
external | The Asset of a external type. |
unknown | Unknown Asset type. |
MXOOptimizationPoint
MXO Interaction response data.
open class MXOOptimizationPoint : NSObject {
open var path: String? { get }
open var actions: [MXOAction]? { get }
open var directives: MXOOptimizationPointDirectives { get }
}
Property | Type | Description |
---|---|---|
path | String? | The location to optimize. |
actions | [MXOAction]? | The set of MXO Actions available to take for the Optimization. |
directives | MXOOptimizationPointDirectives | The position of the Optimization. |
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
}
Enum | Description |
---|---|
replace | The Asset replaces the content area. |
before | The Asset is inserted before the content area. |
after | The Asset is inserted after the content area. |
unknown | The unknown directives for the Asset. |
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 }
}
Property | Type | Description |
---|---|---|
name | String? | The proposition name. |
code | String? | The business code associated with the proposition. |
type | MXOPropositionType | The type of proposition. |
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
}
Enum | Description |
---|---|
product | The product Proposition. |
service | The service Proposition. |
MXORequestOnErrorBlock
The MXO request sent on error.
public typealias MXORequestOnErrorBlock = (
Error
) -> Void
MXORequestOnSuccessBlock
The MXO request sent on success.
public typealias MXORequestOnSuccessBlock = (
MXOInteractionResponse
) -> Void
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?
}
Property | Type | Description |
---|---|---|
value | String? | The response code string value. |
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 }
}
Property | Type | Description |
---|---|---|
interaction | MXOInteraction | The URI value containing the Interaction path. |
responseCode | MXOResponseCode | Response code object containing the response code value. |
onError | MXORequestOnErrorBlock | Provide an MXO error handler. |
onSucces | MXORequestOnSuccessBlock | Provide 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
}
}