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
| Attribute | Definition | Format | Notes |
|---|---|---|---|
| action | The activity type that is being recorded | Enum: possible values include: "SURVEY_RESPONSE", "APP_DOWNLOAD", "APP_CHECKIN" | |
| channel | The channel associated with the activity | Enum, 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. |
| businessUnit | The name of the business unit the activity is being reported on for | String | Can be blank, but if no BU ID is passed in, then any offers belonging to any BU will be considered for evaluation |
| note | Additional information about the activity performed | String | |
| when | ISO date representing when the activity was performed | String | |
| extendedData | Additional data about the activity | Array | May 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. |
| name | The name provided to an additional field of data | String | |
| value | The value provided for the additional field of data identified in the name attribute | String |
Response
| Attribute | Definition | Format | Notes |
|---|---|---|---|
| activityId | GUID associated with the activity sent | String | |
| type | The type of activity | String | |
| earned | The reward associated with the activity | Object | Total reward earned in this BU/partner category |
| "XYZ" (name of the business unit or partner) | The business unit associated with the activity | Object | "XYZ" is replaced by the name of the relevant business unit |
| "loyalty" (type of points awarded) | The type of rewards earned for the activity | Object | "loyalty" refers to points awarded |
| base | Base points awarded for this activity | Number | |
| bonus | Bonus points awarded for this activity | Number | |
| targeted | Targeted points awarded for this activity | Number | |
| total | Total points awarded for this activity | Number |
Error Responses
| statusCode | errorMessage | errorCode | Definition |
|---|---|---|---|
| 400 Bad Request | Provided business unit is not valid | INVALID_REQUEST | Business unit referenced is not a valid business unit |
| 400 Bad Request | Provided businessUnit is disabled | INVALID_REQUEST | Business unit referenced is not enabled for use |
| 400 Bad Request | LoyaltyId specified is not associated with this Account | INVALID_REQUEST | Loyalty ID referenced is not associated with the account |
| 400 Bad Request | ActivityID already exists | INVALID_REQUEST | An activity using the same ID has already been created in the system |
| 400 Bad Request | Channel not found | INVALID_REQUEST | A valid channel value was not included in the request Body |
| 400 Bad Request | Action not found | INVALID_REQUEST | A valid action value was not included in the request Body |
| 400 Bad Request | When not found | INVALID_REQUEST | A valid timestamp (when) value was not included in the request Body |
Request
Responses
- 200
- 400
200 - Send Activity
Response Headers
Date
Example:
Wed, 03 Feb 2021 20:15:17 GMTContent-Length
Example:
83Connection
Example:
keep-alivex-amzn-RequestId
Example:
7247c5dc-3573-470b-9df3-6d2d87e7116eReferrer-Policy
Example:
no-referrerX-XSS-Protection
Example:
1;mode=blockAccess-Control-Allow-Origin
Example:
*Expect-CT
Example:
max-age=86400Strict-Transport-Security
Example:
max-age=31536000Feature-Policy
Example:
vibrate 'none'; geolocation 'none'X-Frame-Options
Example:
sameoriginContent-Security-Policy
Example:
connect-src 'none';object-src https://*.cloudfront.net;script-src https://*.cloudfront.netx-amz-apigw-id
Example:
aL2dPHl2IAMFcsQ=cache-control
Example:
no-cache, no-store, must-revalidateX-Content-Type-Options
Example:
nosniffX-Amzn-Trace-Id
Example:
Root=1-601b0454-4955dd4213a95d683e5bd38e;Sampled=0400 - Invalid businessUnit
Response Headers
Date
Example:
Wed, 03 Feb 2021 20:15:17 GMTContent-Length
Example:
83Connection
Example:
keep-alivex-amzn-RequestId
Example:
7247c5dc-3573-470b-9df3-6d2d87e7116eReferrer-Policy
Example:
no-referrerX-XSS-Protection
Example:
1;mode=blockAccess-Control-Allow-Origin
Example:
*Expect-CT
Example:
max-age=86400Strict-Transport-Security
Example:
max-age=31536000Feature-Policy
Example:
vibrate 'none'; geolocation 'none'X-Frame-Options
Example:
sameoriginContent-Security-Policy
Example:
connect-src 'none';object-src https://*.cloudfront.net;script-src https://*.cloudfront.netx-amz-apigw-id
Example:
aL2dPHl2IAMFcsQ=cache-control
Example:
no-cache, no-store, must-revalidateX-Content-Type-Options
Example:
nosniffX-Amzn-Trace-Id
Example:
Root=1-601b0454-4955dd4213a95d683e5bd38e;Sampled=0