GET GetBadgeChallenges

{baseurl}/api/v1/Integration/GetBadgeChallenges?userId={userId}

Overview

The GetBadgeChallenges API endpoint Retrieves a list of challenges with badge rewards for a specific user, including information about each challenge's status, rewards, and whether it has been achieved or locked.

Once the badge is achieved in the SDK, its image turned into colored.

Use Cases Examples:

  1. Retrieving Badge Challenges for a User:

    • This API fetches a list of badge challenges available to a specific user, including details on whether they have been achieved or are still locked.

  2. Display Challenges in User Profile:

    • The response can be used to display the user's progress in challenges, showing which badges have been earned and which ones are still pending.

  3. Challenge Filtering:

    • The API filters challenges based on visibility rules, ensuring that only relevant challenges are returned based on the user's progress and configuration settings.

Request

Header Parameters

AttributeTypeOptionsDescription

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

PropertyTypeOptionsDescription

UserId

string
Required

The phone number of the user for whom the badge challenges are being retrieved.

Request Example

GET /api/v1/Integration/GetBadgeChallenges?userId=123654

Response

Returns a list of challenges object 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

PropertyTypeDescription

Name

string

The name of the challenge.

Id

int

The unique identifier for the challenge.

IsLocked

bool

Indicates whether the challenge is locked.

IsAchieved

bool

Indicates whether the user has achieved this challenge.

Image

string

The URL for the badge's image.

Rewards*

list

A list of rewards associated with the challenge.

Rewards (List): A list of rewards associated with the challenge.

PropertyTypeDescription

Id

int

The unique identifier for the reward.

Name

string

The name of the reward.

RewardType*

list

The type of reward (e.g., Badge = 3).

Enums

Reward Type

  • Voucher = 1

  • Points = 2

  • Badge = 3


enum RewardType
{
    Voucher = 1,
    Points = 2,
    Badge = 3
}

Response Sample

Success respone
{
    "result": [
        {
            "name": "Most Loyal",
            "image": "https://storage.googleapis.com/dsq-staging/staging/Gamification/images/Staging/Challenges/Most%20Loyal_1.jpg?X-Goog-Algorithm=GOOG4-RSA-SHA256&X-Goog-Credential=upload-service%40warm-ring-360408.iam.gserviceaccount.com%2F20240812%2Fauto%2Fstorage%2Fgoog4_request&X-Goog-Date=20240812T163947Z&X-Goog-Expires=21600&X-Goog-SignedHeaders=host&X-Goog-Signature=72145b6fa3fb01c47b658fa7683c0b6b2a0874291e4c9813ee3929c792ea090488b626b0271522351f23525536e769e5c74fc5a7f97883f07ba82c789c9fcd427a1c8ae7e5881d33d593087bba39998df74e04715568d954f1cdc65f08e4202ef4f35d1c5722e683102a5d468ea79444e8e00baaf9a9e4280a63999697baf9f9790ac39bf9f929f62b5590e537c1a4aa76ae2ad9a716c323fb476338bf10ad97aa7e351318615401a082d63e315cf76d2fcba614db3bb4a66e0bd2549172e7b640c264eead529796a2157a5815911d5df9fefc8ca190e25cda95a4655307ffc2d0f14b95c04d935558c4e9fb44b29198198c75a6d8cb0b5c95c1d91cb1bdf737",
            "isAchieved": true,
            "isLocked": false,
            "rewards": [
                {
                    "name": "Food lovers Badge",
                    "rewardType": 3,
                    "id": 0
                }
            ],
            "id": 317
        }
    ],
    "message": "Process completed successfully",
    "statusCode": 1,
    "statusName": "Successfully"
}

Last updated