Interaction API

The Interaction API allows you to:

  • Track customer activity from your touchpoint solution.
  • Update customer profile data stored in MXO.
  • Receive optimized content responses for the best conversation to have with a customer.
  • Buffer requests to support offline mode and to reduce network calls.
Important: Offline Interaction endpoints were deprecated and replaced by the new Batch Interaction API.

Authentication and authorization

MXO security framework uses OAuth 2.0 for authenticating access to data. For detailed information on how to create API credentials for a user and request an OAuth 2.0 token from MXO, see MXO API security.

Available API calls

We provide the API calls listed below:

MethodSummaryDetails
POST/one/oauth2/rt/api/2.0/interaction/Send information about customer interactions to MXO in real-time. Use POST when you want to return optimizations in the response or when you want to register activity immediately.
PUT/one/oauth2/rt/api/2.0/interaction/Update the customer profile with details of captured and tracked activity. No optimizations are returned to customers.
PUT/one/oauth2/rt/api/2.0/interaction/offlineSend individual historic offline interactions to MXO. No optimizations are returned to customers. You must provide the timestamp when the customer interaction occurred. If interactions are being buffered by the touchpoint, for example, if a mobile device goes offline for a short period of time, the timestamp relates to time at which the interaction occurred and not the time the interaction was flushed to MXO.
PUT/one/oauth2/rt/api/2.0/interactions/offlineSend multiple offline interactions to MXO. No optimizations are returned to customers. Use to buffer multiple activities into a single request to MXO when you need to reduce network traffic or buffer activity when offline. This API supports a maximum of 100 offline interactions per call.

Interaction request elements

The table below provides an overview of the key elements to include as part of the interaction request.

ElementTypeRequiredDescription
Query parameters
skSTRINGRequiredSite key for your space.
tidSTRINGOptionalUnique identifier with which you want to associate the interaction.
Headers
Content-TypeSTRINGRequiredDefault value: application/json.
AuthorizationSTRINGOptional Default value: Bearer (TOKEN).
dataMimeTypeSTRINGRequiredSet to application/json to return optimizations as a collection of actions; that is, return more than one action.
Body
urlSTRINGRequiredFull touchpoint/interaction URI as configured in MXO for the target interaction.
customerKeySTRINGOptionalKey for the specific, recognized, customer with which you want to associate the Interaction. Required if customerKeyName is provided.
customerKeyNameSTRINGOptionalAPI name of the key with which the customerKey value should associated as part of the Interaction.

Default value: customerkey.

propertiesARRAYOptionalProvided to return optimizations as a collection of actions; that is, return more than one action.
device
Important: The device object is optional. However, if included, it must contain non-empty deviceAppName, and both devType and osName must resolve to non-null enums to successfully persist.
OBJECTOptionalArray of objects containing context and metadata about the user's device. For example:
{                                                                                                                                                                                                      
       "device": {                                                                                                                                                                                          
         "deviceAppName": "Chrome",                                                                                                                                                                         
         "devType": "PERSONAL_COMPUTER",                                                                                                                                                                    
         "osName": "WINDOWS"                                                                                                                                                                                
       }                                                                                                                                                                                                    
     }  
device child elements
deviceAppName STRINGOptionalName of the application on the device. Accepts any non-empty string.
deviceAppVersionSTRINGOptionalVersion of the application.
devMfrSTRINGOptionalDevice manufacturer name.
devModelSTRINGOptionalDevice model name.
devTypeSTRING (ENUM)Optional Type of device.

Accepted values: GAME_CONSOLE, PDA, PERSONAL_COMPUTER, SMART_TV, SMARTPHONE, TABLET, WEARABLE, OTHER, TV, DATA_COLLECTION_TERMINAL, WIRELESS_HOTSPOT, MOBILE_PHONE, SET_TOP_BOX, DESKTOP, VEHICLE_MULTIMEDIA_SYSTEM, PAYMENT_TERMINAL, SINGLE_BOARD_COMPUTER, MEDIA_PLAYER, REFRIGERATOR, PROJECTOR, DIGITAL_HOME_ASSISTANT, EMBEDDED_NETWORK_MODULE, TELEMATICS_CONTROL_UNIT, WRISTWATCH, VR_HEADSET.

Note: Invalid values will automatically default to OTHER.
osNameSTRING (ENUM)Optional Operating system name.

Accepted values: ANDROID, WINDOWS, IOS, OSX, LINUX, OTHER, WINDOWS_NT, IPAD_OS, WINDOWS_RT, LINUX_MINT, WINDOWS_VISTA, LINUX_SLACKWARE, CHROME_OS, WINDOWS_11, WINDOWS_8_1, RIM, OS_2, FREEBSD, WINDOWS_10, WINDOWS_NT_4_10, WEBOS, WINDOWS_8, WINDOWS_XP, FUCHSIA, HARMONY_OS, OPENBSD, KAIOS, TIZEN, PLAYSTATION_4_OS, WINDOWS_NT_4_0, FIREFOX_OS, LG_PROPRIETARY, WINDOWS_MOBILE, PLAYSTATION_5_OS, SAMSUNG_PROPRIETARY, NETBSD, BREW, LINUX_UBUNTU, LINUX_FEDORA, WINDOWS_2000, WINDOWS_7.

Note: Invalid values will automatically default to OTHER. Passing null or omitting this when device is present will result in a DeviceEvent precondition failure.
deviceOsVersionSTRINGOptionalOperating system version.
deviceLocationLatitudeNUMBER (DOUBLE)OptionalGeographic latitude coordinate of the device.
deviceLocationLongitudeNUMBER (DOUBLE)OptionalGeographic longitude coordinate of the device.
deviceLocationLastUpdateDATE-TIMEOptionalTimestamp of last location update. Usually, an ISO-8601 formatted date/time string.
deviceLocationHorizontalAccuracyNUMBER (FLOAT)OptionalHorizontal accuracy radius of the location data.
ipAddressSTRINGOptionalIP address string. Passing "detect" will cause the API to automatically substitute it with the caller's remote IP address.
localeSTRINGOptionalLocale string (typically BCP-47 format, e.g., en-GB or en-US).
deviceFlashEnabledBOOLEANOptionalIndicates if Adobe Flash is enabled (true/false).

Interaction response elements

For each interaction request, the elements listed below may be present in the response.

ElementTypeDescription
statusCodeINTEGERStatus of the request sent the server.
tidSTRINGTID of the customer assigned to the interaction. The value should be retained for later use to properly track anonymous activity
trackersARRAYCollection of activity capture points associated with the interaction or region.
capturesARRAYCollection of page element attribute capture points associated with the interaction or region.
optimizationsARRAYArray of optimization points returned for the customer, based on any decisioning associated with the interaction or region.

Response status codes

MXO can return the following status codes in a response.

Status CodeDescription
200Request successfulHandler
400Bad Input Parameter
401Invalid OAuth 2.0 token
403User lacks permissions to perform operation
404Not found
405Method not allowed
500Internal server error

Example use case — Tell MXO about a customer interaction on a touchpoint

You want to record details in the AEP about a customer interaction on a touchpoint.

Example parameters

FieldDescription
Site KeyONE-NX8P2RSAAU-1813
Touchpoint and Contextapi://my.touchpoint/customer/interaction
Customer Keymy-customer-id
TIDReturned on first request

Example API call - Request

FieldDescription
Request MethodPOST
Request URL/one/oauth2/rt/api/2.0/interaction?sk=ONE-NX8P2RSAAU-1813
Request HeadersAuthorization header: HTTP Basic. Generated using the credentials supplied for the request, encoded in Base64. Example: Authorization: Basic MmU4ZmVjMGUtMzRmYi00ODUxLTgwMGUtOTk4OTMzMWU1NWQ yOmQ3ZjQ0ODRmLTk4MTctNDc3OC05MTYxLTZlYjA2ZDFmNmNmNw== Content-Type: application/x-www-form-urlencoded
Request Body
{
   "customerKey":"my-customer-id",
   "uri":"api://my.touchpoint/customer/interaction"
   }

Example API call - Response

Expected response code

200 SUCCESS

Expected response body

{
   "statusCode": 200,
   "tid":"dedc2983-4666-4641-8047-61250a878f89"
}