Skip to main content

Issue Quest Points

To issue Quest Points in your game, you need to send an API request with the required headers and body parameters. The process allows you to award points to a user for their participation in a specific quest.

API Endpoint​

POST /group-quests/<questId>/points

Headers​

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

API_KEY: your-api-key-here

This endpoint also supports an IDEMPOTENCY_KEY header to prevent duplicate actions. For more information, see Idempotency.

IDEMPOTENCY_KEY: 123e4567-e89b-12d3-a456-426614174000

Path Parameters​

ParamDescription
questIdThe unique ID of the quest in YGG's system. YGG will provide your questId to you.

Body Parameters​

ParamTypeDescription
yggUserIdStringThe unique ID of the user in YGG's system. If you need to retrieve the yggUserId for a particular user, you can use the Identify a User endpoint.
eventPointsNumberThe number of points to be issued to the user. This value can be an integer or a float
eventNameString (optional)The name of the event associated with issuing the points. If not provided, the value will default to DefaultPointsEvent.
eventDescriptionString (optional)A description of the event.

Here is an example of the JSON structure for the request body:

{
"yggUserId": "user123",
"eventPoints": 100,
"eventName": "Quest Completion",
"eventDescription": "Completed the treasure hunt quest"
}

Responses​

  • Success (200): If the Quest Points are successfully issued, you will receive a 200 response with the following body:

    {
    "success": true
    }
  • Error (400): If there is an error in the request, such as invalid data, you will receive a 400 response with the following body:

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

Example Request​

Here’s an example using curl to issue Quest Points:

curl -X POST /group-quests/quest-123/points \
-H "API_KEY: your-api-key-here" \
-H "Content-Type: application/json" \
-d '{
"yggUserId": "user123",
"eventPoints": 100,
"eventName": "Quest Completion",
"eventDescription": "Completed the treasure hunt quest"
}'

This request will issue Quest Points to the user with the yggUserId of user123 for the quest with questId quest123, while also specifying an event name and description for context.