Skip to main content

Send Activity (with Activity ID)

POST 

/client/users/:correlation_id/activities/:activity_id

Sends an activity associated with a user.

  • An activity_id is passed in with the request as the activity_Id variable in the URL. If an activity_Id value is not passed in via the URL, then a GUID is generated.

  • If businessUnit is passed in, then offers that belong to that BU are evaluated. Otherwise, if no BU is passed in, offers belonging to any BU will be considered for evaluation.

Note: A single session (correlationID) can process multiple activities. For every request, the ActivityId should be unique.

Request

Body

AttributeDefinitionFormatNotes
actionThe activity type that is being recordedEnum: possible values include: "SURVEY_RESPONSE", "APP_DOWNLOAD", "APP_CHECKIN"
channelThe channel associated with the activityEnum, commonly-used values: "APP", "STORE", "POS", "PARTNER" or "WEBSITE"Depending on client implementation, the default is "APP" or "STORE". Note that the client may supply their own custom value, but it cannot be null or blank.
businessUnitThe name of the business unit the activity is being reported on forStringCan be blank, but if no BU ID is passed in, then any offers belonging to any BU will be considered for evaluation
noteAdditional information about the activity performedString
whenISO date representing when the activity was performedString
extendedDataAdditional data about the activityArrayMay be useful for reporting and/or analytics. Note that contents are not validated, only top-level attributes are allowed, and only up to 20 attributes with a max. size of 5KB are accepted.
nameThe name provided to an additional field of dataString
valueThe value provided for the additional field of data identified in the name attributeString

Response

AttributeDefinitionFormatNotes
activityIdGUID associated with the activity sentString
typeThe type of activityString
earnedThe reward associated with the activityObjectTotal reward earned in this BU/partner category
"XYZ" (name of the business unit or partner)The business unit associated with the activityObject"XYZ" is replaced by the name of the relevant business unit
"loyalty" (type of points awarded)The type of rewards earned for the activityObject"loyalty" refers to points awarded
baseBase points awarded for this activityNumber
bonusBonus points awarded for this activityNumber
targetedTargeted points awarded for this activityNumber
totalTotal points awarded for this activityNumber

Error Responses

statusCodeerrorMessageerrorCodeDefinition
400 Bad RequestProvided business unit is not validINVALID_REQUESTBusiness unit referenced is not a valid business unit
400 Bad RequestProvided businessUnit is disabledINVALID_REQUESTBusiness unit referenced is not enabled for use
400 Bad RequestLoyaltyId specified is not associated with this AccountINVALID_REQUESTLoyalty ID referenced is not associated with the account
400 Bad RequestActivityID already existsINVALID_REQUESTAn activity using the same ID has already been created in the system
400 Bad RequestChannel not foundINVALID_REQUESTA valid channel value was not included in the request Body
400 Bad RequestAction not foundINVALID_REQUESTA valid action value was not included in the request Body
400 Bad RequestWhen not foundINVALID_REQUESTA valid timestamp (when) value was not included in the request Body

Request

Responses

200 - Send Activity

Response Headers
    Date
    Example: Wed, 03 Feb 2021 20:15:17 GMT
    Content-Length
    Example: 83
    Connection
    Example: keep-alive
    x-amzn-RequestId
    Example: 7247c5dc-3573-470b-9df3-6d2d87e7116e
    Referrer-Policy
    Example: no-referrer
    X-XSS-Protection
    Example: 1;mode=block
    Access-Control-Allow-Origin
    Example: *
    Expect-CT
    Example: max-age=86400
    Strict-Transport-Security
    Example: max-age=31536000
    Feature-Policy
    Example: vibrate 'none'; geolocation 'none'
    X-Frame-Options
    Example: sameorigin
    Content-Security-Policy
    Example: connect-src 'none';object-src https://*.cloudfront.net;script-src https://*.cloudfront.net
    x-amz-apigw-id
    Example: aL2dPHl2IAMFcsQ=
    cache-control
    Example: no-cache, no-store, must-revalidate
    X-Content-Type-Options
    Example: nosniff
    X-Amzn-Trace-Id
    Example: Root=1-601b0454-4955dd4213a95d683e5bd38e;Sampled=0