Skip to main content

Get Enrolled User

To verify if a specific user is enrolled in a particular quest, send an API request using their yggUserId. This endpoint will confirm the user’s enrollment status and provide a timestamp if the user is enrolled.

If you want to retrieve all users enrolled in a quest, use the Get All Enrolled Users endpoint.

API Endpoint

To check a user's enrollment in a quest, use the following endpoint:

GET /group-quests/{questId}/enrolled-users/{yggUserId}

Headers

You must include your API_KEY in the request header for authentication. The required format is:

API_KEY: your-api-key-here

Path Parameters

ParameterDescription
questIdThe unique ID of the quest in YGG's system.
yggUserIdThe unique ID of the user in YGG's system.

Responses

  • Success (200): If the user is enrolled in the quest, a 200 response will be returned with the following body:

    {
    "success": true,
    "data": {
    "yggUserId": "user456",
    "enrolled": true,
    "currentPoints": 12
    }
    }
  • Not Enrolled (404): If the user is not enrolled in the quest, a 404 response will be returned with the following body:

    {
    "success": false,
    "message": "User is not enrolled in the quest"
    }
  • Error (400): If there is an issue with the request, such as an invalid questId, yggUserId, or missing authentication, a 400 response will be returned with the following body:

    {
    "success": false,
    "message": "Description of the error"
    }

Example Request

Here’s an example using curl to check if a user is enrolled in a specific quest:

curl -X GET /group-quests/quest123/enrolled-users/user456 \
-H "API_KEY: your-api-key-here"

Test Environment

In the test environment, any yggUserId will return a successful response. To test a Not Enrolled (404) response, use a yggUserId of user_not_enrolled.