Last updated
Last updated
GET
GetChallengeHistoryForUserThe 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.
X-ClientId and X-Message are only required with V1 API.
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.
Rewards (list): A list of rewards earned from the challenge.
Attribute | Type | Options | Description |
---|---|---|---|
Property | Type | Options | Description |
---|---|---|---|
Property | Type | Description |
---|---|---|
Parameter | Type | Description |
---|---|---|
X-ClientId
Provided Client Id.
X-Message
Provided encrypted message.
Accept-language
Selected language for response.
UserId
The phone number of the user for whom challenges are being retrieved.
Page
The page number of the results to retrieve. Default is 1.
ItemsPerPage
The number of items per page. Default is 10.
SearchQuery
A search string to filter challenges by name.
OrderBy
The field to order the results by. Default is Id
.
IsAscending
A flag indicating whether the results should be ordered in ascending order. Default is true
.
ChallengeId
Unique identifier for the challenge.
ChallengeName
The name of the challenge, based on the user's preferred language.
DateCreated
The date and time when the challenge was completed.
Image
The URL for the challenge's image.
Rewards*
A list of rewards earned from the challenge.
Name
The name of the reward.
RewardType*
The type of the reward (e.g.,Voucher, Points).
RewardValue
The value of the reward (e.g., points, voucher value).
RewardDiscription
A description of the reward.
Status*
A list of rewards earned from the challenge.
ExpirationDate
The status of the reward (e.g., Active, Expired, Burnt).
DateCreated
The date when the reward was granted.