Get Member Aggregations
GET/client/users/:correlation_id/aggregations
This API is to retrieve aggregations for a particular member corresponding their periods, if it's enabled in AGGREGATION config.
Request
Query Parameters
| Attribute | Description | Format | Notes |
|---|---|---|---|
| periods | current period + x-1 past periods (years) to be included to show member's aggregations | Number | If not passed then it will take default value of periods that is mentioned in AGGREGATION config under DisplaySettings. |
Body
This request does not have a body.
Response
An object of arrays. In which, the first key would be their corresponding aggregation name.
| Attribute | Definition | Format | Note |
|---|---|---|---|
| [key] | Corresponding Aggregation Name | Array containing objects | e.g. SPEND_YEAR, SPEND_QUARTER, SPEND_MONTH, SPEND_LIFETIME, REWARDS_YEAR, REDEEM_YEAR, dependent on configuration; the following attributes are in separate objects for each specified period in the [key] array (only one value is shown for SPEND_LIFETIME) |
| periodStartDate | Corresponding aggregation's start date | String | In UTC time. |
| periodEndDate | Corresponding aggregation's end date | String | In UTC time. |
| value | Corresponding aggregation's value | Number | Value in points for specified period and key |
Error Responses
See examples for possible error states.
| statusCode | errorMessage | errorCode | Notes |
|---|---|---|---|
| 400 - Bad Request | Periods is required to be positive numeric value. | INVALID_REQUEST | The number of periods must be a positive number. |
| 400 - Bad Request | Exceeded the maximum number of periods allowed: 3. | INVALID_REQUEST | The number of periods specified in the query parameters exceed the maximum allowable value. |
Request
Responses
- 200
- 400
200 - Get Member Aggregations
400 - Invalid periods