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.
@interface MXOAction : NSObject
@property (nonatomic, copy, nullable, readonly) NSString *name;
@property (nonatomic, strong, nullable, readonly) MXOAsset *asset;
@property (nonatomic, strong, nullable, readonly) MXOProposition *proposition;
@end
Property | Type | Description |
---|---|---|
name | NSString | 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.
@interface MXOAsset : NSObject
@property (nonatomic, copy, nullable, readonly) NSString *markup;
@property (nonatomic, strong, nullable, readonly) NSArray<MXOAssetResponse *> *responses;
@property (nonatomic, assign, readonly) MXOMimeType mimeType;
@property (nonatomic, strong, nullable, readonly) NSString *contentUrl;
@end
Property | Type | Description |
---|---|---|
markup | NSString | The language markup for presenting the Asset. |
responses | NSArray<MXOAssetResponse *> | The optional responses for informing MXO of a user Interaction with the Asset. |
mimeType | MXOMimeType | The markup language type. |
contentUrl | NSString | A remote location the Asset represents. |
MXOAssetResponse
MXO Asset response for tracking.
@interface MXOAssetResponse : NSObject
@property (nonatomic, strong, nullable, readonly) MXOResponseCode *code;
@property (nonatomic, assign, readonly) MXOAssetResponseSentiment sentiment;
@property (nonatomic, strong, nullable, readonly) NSString *label;
@property (nonatomic, strong, nullable, readonly) NSString *imageUrl;
@property (nonatomic, strong, nullable, readonly) NSString *targetUrl;
@property (nonatomic, assign, readonly) MXOAssetResponseTarget target;
@end
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 | NSString | The label to show if desired. |
imageUrl | NSString | The image to load if desired. |
targetUrl | NSString | 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.
typedef NS_ENUM(NSInteger, MXOAssetResponseSentiment) {
MXOAssetResponseSentimentPositive,
MXOAssetResponseSentimentNeutral,
MXOAssetResponseSentimentNegative,
MXOAssetResponseSentimentUnknown
};
Enum | Description |
---|---|
MXOAssetResponseSentimentPositive | The positive tap on an Asset. |
MXOAssetResponseSentimentNeutral | The Asset is dismissed or ignored. |
MXOAssetResponseSentimentNegative | The Asset is rejected. |
MXOAssetResponseSentimentUnknown | Unknown response. |
MXOAssetResponseTarget
The location of an MXO Asset response.
typedef NS_ENUM(NSInteger, MXOAssetResponseTarget) {
MXOAssetResponseTargetInApp,
MXOAssetResponseTargetExternal,
MXOAssetResponseTargetContext,
MXOAssetResponseTargetUnknown
};
Enum | Description |
---|---|
MXOAssetResponseTargetInApp | The Asset is targeted to the same app. |
MXOAssetResponseTargetExternal | The Asset is targeted to an external URL. |
MXOAssetResponseTargetContext | The Asset is targeted to an Action context. |
MXOAssetResponseTargetUnknown | Unknown response. |
MXOCaptureActivityPoint
Capture user Activity when they interact with an MXO Interaction.
@interface MXOCaptureActivityPoint : NSObject
@property (nonatomic, copy, nullable, readonly) NSString *identifier;
@property (nonatomic, copy, nullable, readonly) NSString *path;
@end
Property | Type | Description |
---|---|---|
identifier | NSString | The internal MXO id of the point. |
path | NSString | The location of Activity to capture, such as a button click. |
MXOCaptureAttributePoint
Capture user Attribute when they interact with an MXO Interaction.
@interface MXOCaptureAttributePoint : NSObject
@property (nonatomic, copy, nullable, readonly) NSString *identifier;
@property (nonatomic, copy, nullable, readonly) NSString *path;
@property (nonatomic, assign, readonly) MXOCaptureElementType elementType;
@property (nonatomic, copy, nullable, readonly) NSString *elementName;
@property (nonatomic, copy, nullable, readonly) NSString *elementAttributeName;
@property (nonatomic, readonly) NSInteger captureDelay;
@property (nonatomic, assign, readonly) MXOCaptureType captureType;
@property (nonatomic, assign, readonly) MXOCapturePhase capturePhase;
@end
Property | Type | Description |
---|---|---|
identifier | NSString | The internal MXO id of the point. |
path | NSString | The location of Attribute to capture, such as a button click. |
elementType | MXOCaptureElementType | The type of the element. |
elementName | NSString | The name of the element. |
elementAttributeName | NSString | The name of the element Attribute to capture. |
captureDelay | NSInteger | 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.
typedef NS_ENUM(NSInteger, MXOCaptureElementType) {
MXOCaptureElementTypeTextField,
MXOCaptureElementTypeCheckboxRadio,
MXOCaptureElementTypeDisplayElem,
MXOCaptureElementTypeDropDown,
MXOCaptureElementTypeUnknown
};
Enum | Description |
---|---|
MXOCaptureElementTypeTextField | Input value for the text or search field. |
MXOCaptureElementTypeCheckboxRadio | Input value for the selected checkbox/radio button. |
MXOCaptureElementTypeDisplayElem | Display value for the selected display element. |
MXOCaptureElementTypeDropDown | Input value for the selected dropdown list. |
MXOCaptureElementTypeUnknown | The unknown Attribute capture element type. |
MXOCapturePhase
The phase in which to capture an Attribute.
typedef NS_ENUM(NSInteger, MXOCapturePhase) {
MXOCapturePhaseLoad,
MXOCapturePhaseOnClick,
MXOCapturePhaseParameter,
MXOCapturePhaseUnknown
};
Enum | Description |
---|---|
MXOCapturePhaseLoad | The Attribute is captured whenever a page is loaded. |
MXOCapturePhaseOnClick | The Attribute is captured once clicked or tapped. |
MXOCapturePhaseParameter | The Attribute is captured for a query parameter. |
MXOCapturePhaseUnknown | The unknown Attribute capture phase. |
MXOCaptureType
The type of value to capture from an element.
typedef NS_ENUM(NSInteger, MXOCaptureType) {
MXOCaptureTypeAttribute,
MXOCaptureTypeText,
MXOCaptureTypeValue,
MXOCaptureTypeCookie,
MXOCaptureTypeUnknown,
};
Enum | Description |
---|---|
MXOCaptureTypeAttribute | Name of the Attribute. |
MXOCaptureTypeText | Captures a text. |
MXOCaptureTypeValue | Captures a Boolean value. |
MXOCaptureTypeCookie | Captures data from a cookie on the current page. |
MXOCaptureTypeUnknown | 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.
@interface MXOInteraction : NSObject
@property (atomic, strong, readonly, nullable) NSURL *value;
@end
Property | Type | Description |
---|---|---|
value | NSURL | The UIR representation of the Interaction. |
MXOIntractionRequest
The Interaction request object for sending interaction data from the MXO SDK.
@interface MXOInteractionRequest : MXORequest
@property (nonatomic, strong, readonly, nullable) MXOInteraction *interaction;
@property (nonatomic, strong, readonly, nullable) NSDictionary<NSString *, NSString *> *properties;
@property (nonatomic, copy, readonly, nullable) MXORequestOnErrorBlock onError;
@property (nonatomic, copy, readonly, nullable) MXORequestOnSuccessBlock onSuccess;
@end
Property | Type | Description |
---|---|---|
interaction | MXOInteraction | The Interaction to be sent to MXO. |
properties | NSDictionary<NSString *, NSString *> | 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:
MXOInteractionRequest *interactionRequest = [MXOInteractionRequest initWithBuilder:^(MXOInteractionRequestBuilder * _Nonnull builder) {
builder.interaction = [MXOInteraction initWithString:@"/" error:&error];
builder.properties = @{@"name": @"value"};
builder.onError = ^(NSError *error) {
// process error
}
builder.onSuccess = ^(MXOInteractionResponse *response) {
// process response
}
}];
sendinteraction
MXOIntractionResponse
MXO Interaction response data.
@interface MXOInteractionResponse : NSObject
@property (nonatomic, strong, nullable, readonly) MXOInteraction *interaction;
@property (nonatomic, copy, nullable, readonly) NSString *tid;
@property (nonatomic, strong, nullable, readonly) NSArray<MXOOptimizationPoint *> *optimizationPoints;
@property (nonatomic, strong, nullable, readonly) NSArray<MXOCaptureAttributePoint *> *captureAttributePoints;
@property (nonatomic, strong, nullable, readonly) NSArray<MXOCaptureActivityPoint *> *captureActivityPoints;
@end
Property | Type | Description |
---|---|---|
interaction | MXOInteraction | The interaction this response is for. |
tid | NSString | The unique id for this user's interaction. |
optimizationPoints | NSArray<MXOOptimizationPoint *> | The MXO Interaction Response for Optimization Points. |
captureActivityPoints | NSArray<MXOCaptureActivityPoint *> | The MXO Interaction Response for Activity Points. |
captureAttributePoints | NSArray<MXOCaptureAttributePoint *> | The MXO Interaction Response for Attribute Points. |
MXOMimeType
Possible types of MXO Assets.
typedef NS_ENUM(NSInteger, MXOMimeType) {
MXOMimeTypeJSON,
MXOMimeTypeTXT,
MXOMimeTypeHTML,
MXOMimeTypeXML,
MXOMimeTypeExternal,
MXOMimeTypeUnknown
};
Enum | Description |
---|---|
MXOMimeTypeJSON | The Asset of a json type. |
MXOMimeTypeTXT | The Asset of a text type. |
MXOMimeTypeHTML | The Asset of a html type. |
MXOMimeTypeXML | The Asset of a xml type. |
MXOMimeTypeExternal | The Asset of a external type. |
MXOMimeTypeUnknown | Unknown Asset type. |
MXOOptimizationPoint
MXO Interaction response data.
@interface MXOOptimizationPoint : NSObject
@property (nonatomic, copy, nullable, readonly) NSString *path;
@property (nonatomic, strong, nullable, readonly) NSArray<MXOAction *> *actions;
@property (nonatomic, assign, readonly) MXOOptimizationPointDirectives directives;
@end
Property | Type | Description |
---|---|---|
path | NSString | The location to optimize. |
actions | NSArray<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.
typedef NS_ENUM(NSInteger, MXOOptimizationPointDirectives) {
MXOOptimizationPointDirectiveReplace,
MXOOptimizationPointDirectiveBefore,
MXOOptimizationPointDirectiveAfter,
MXOOptimizationPointDirectiveUnknown
};
Enum | Description |
---|---|
MXOOptimizationPointDirectiveReplace | The Asset replaces the content area. |
MXOOptimizationPointDirectiveBefore | The Asset is inserted before the content area. |
MXOOptimizationPointDirectiveAfter | The Asset is inserted after the content area. |
MXOOptimizationPointDirectiveUnknown | 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.
@interface MXOProposition : NSObject
@property (nonatomic, copy, nullable, readonly) NSString *name;
@property (nonatomic, copy, nullable, readonly) NSString *code;
@property (nonatomic, assign, readonly) MXOPropositionType type;
@end
Property | Type | Description |
---|---|---|
name | NSString | The proposition name. |
code | NSString | 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.
typedef NS_ENUM(NSInteger, MXOPropositionType) {
MXOPropositionTypeProduct,
MXOPropositionTypeService
};
Enum | Description |
---|---|
MXOPropositionTypeProduct | The product Proposition. |
MXOPropositionTypeService | The service Proposition. |
MXORequestOnErrorBlock
The MXO request sent on error.
typedef void (^MXORequestOnErrorBlock)(
NSError *error
);
Property | Type | Description |
---|---|---|
error | NSError | Used to handle errors. |
MXORequestOnSuccessBlock
The MXO request sent on success.
typedef void (^MXORequestOnSuccessBlock)(
MXOInteractionResponse *response
);
Property | Type | Description |
---|---|---|
response | MXOInteractionResponse | The response for the Interaction. |
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.
@interface MXOResponseCode : NSObject
@property (nonatomic, copy, nullable) NSString *value;
@end
Property | Type | Description |
---|---|---|
value | NSString | The response code string value. |
MXOResponseCodeRequest
The response code request object for sending the response code to the MXO SDK.
@interface MXOResponseCodeRequest : MXORequest
@property (nonatomic, strong, readonly, nullable) MXOInteraction *interaction;
@property (nonatomic, strong, readonly, nullable) MXOResponseCode *responseCode;
@property (nonatomic, copy, readonly, nullable) MXORequestOnErrorBlock onError;
@property (nonatomic, copy, readonly, nullable) MXORequestOnSuccessBlock onSuccess;
@end
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:
MXOResponseCodeRequest *request = [MXOResponseCodeRequest initWithBuilder:^(MXOResponseCodeRequestBuilder * _Nonnull builder) {
builder.interaction = [MXOInteraction initWithString:@"/" error:&error];
builder.responseCode = [MXOResponseCode initWithResponseCode:responseCode error:nil];
builder.onError = ^(NSError *error) {
// process error
}
builder.onSuccess = ^(MXOInteractionResponse *response) {
// process response
}
}];