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

Available API Calls

We provide the following API calls:

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 following table provides an overview of the key elements to include as part of the interaction request.

ElementTypeRequired?Default ValueDescription
Query Parameters
skSTRINGYesN/ASite Key for your Space.
tidstringNoN/AUnique Thunderhead Identifier with which you want to associate the Interaction.
Headers
Content-TypeSTRINGYesapplication/json
AuthorizationSTRINGYesBearer (TOKEN)
dataMimeTypeSTRINGYesN/ASet to application/json to return optimizations as a collection of actions; that is, return more than one action.
Body
urlSTRINGYesN/AFull Touchpoint/Interaction URI as configured in MXO for the target Interaction
customerKeySTRINGNoN/AThe key for the specific, recognized, customer with which you want to associate the Interaction. Required IF customerKeyName is provided.
customerKeyNameSTRINGNocustomerkeyThe API Name of the key with which the customerKey value should associated as part of the Interaction.
propertiesARRAYNoN/AProvided to return optimizations as a collection of actions; that is, return more than one action.
deviceOBJECTNoN/AAn array of objects consisting of container name/value pairs. For example, "name":"ck", "value":"1234"}.

Interaction Response Elements

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

ElementTypeDescription
statusCodeINTEGERThe status of the request sent the server.
tidSTRINGThe TID of the customer assigned to the interaction. The value should be retained for later use to properly track anonymous activity
trackersARRAYThe collection of Activity Capture Points associated with the
interaction or region.
capturesARRAYThe collection of Page Element Attribute Capture Points associated with the interaction or region.
optimizationsARRAYThe array 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"
   }

Response

Expected Response Code

200 SUCCESS

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