GET
GetChallengeHistoryForUser
GET
GetChallengeHistoryForUserOverview
The GetChallengeHistoryForUser
API endpoint retrieves the history of challenges completed by a specific user, including details about rewards earned, their status, and the date of expiration.
Use Cases Examples:
Retrieving a User's Challenge History:
This API fetches the history of challenges completed by a specific user, including the details of rewards earned and their statuses.
Display Reward History in User Profile:
The response can be used to display a timeline or history of challenges completed by the user, showing the rewards they've earned and their current statuses (e.g., expired, active).
Reward Expiration Management:
The API automatically updates the status of rewards (e.g., marking them as expired if the expiration date has passed). This ensures users only see valid and up-to-date information about their rewards.
Request
Header Parameters
Attribute | Type | Options | Description |
---|---|---|---|
X-ClientId | string | Required | Provided Client Id. |
X-Message | string | Required | Provided encrypted message. |
Accept-language | string | Optional | Selected language for response. |
X-ClientId and X-Message are only required with V1 API.
Query Parameters
Property | Type | Options | Description |
---|---|---|---|
UserId | string | Required | The phone number of the user for whom challenges are being retrieved. |
Page | int | Optional | The page number of the results to retrieve. Default is 1. |
ItemsPerPage | int | Optional | The number of items per page. Default is 10. |
SearchQuery | string | Optional | A search string to filter challenges by name. |
OrderBy | string | Optional | The field to order the results by. Default is |
IsAscending | bool | Optional | A flag indicating whether the results should be ordered in ascending order. Default is |
Request Example
Response
Returns an object with rewards details if successful. Otherwise, return status Code message error.
Response Fields:
data
(List): A list of challenges.pagesNum
(int): The current page number.count
(int): The total number of challenges matching the criteria.
Response Parameters
Property | Type | Description |
---|---|---|
ChallengeId | int | Unique identifier for the challenge. |
ChallengeName | string | The name of the challenge, based on the user's preferred language. |
DateCreated | datetime | The date and time when the challenge was completed. |
Image | string | The URL for the challenge's image. |
Rewards* | list | A list of rewards earned from the challenge. |
Rewards (list): A list of rewards earned from the challenge.
Parameter | Type | Description |
---|---|---|
Name | string | The name of the reward. |
RewardType* | enum | The type of the reward (e.g.,Voucher, Points). |
RewardValue | string | The value of the reward (e.g., points, voucher value). |
RewardDiscription | string | A description of the reward. |
Status* | enum | A list of rewards earned from the challenge. |
ExpirationDate | datetime | The status of the reward (e.g., Active, Expired, Burnt). |
DateCreated | datetime | The date when the reward was granted. |
Enums
Response Sample
Last updated