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β
| Param | Description |
|---|---|
questId | The unique ID of the quest in YGG's system. YGG will provide your questId to you. |
Body Parametersβ
| Param | Type | Description |
|---|---|---|
yggUserId | String | The 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. |
eventPoints | Number | The number of points to be issued to the user. This value can be an integer or a float |
eventName | String (optional) | The name of the event associated with issuing the points. If not provided, the value will default to DefaultPointsEvent. |
eventDescription | String (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
200response with the following body:{
"success": true
} -
Error (400): If there is an error in the request, such as invalid data, you will receive a
400response 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.