Quests

Overview

This endpoint allows you to list the quests of your community.

The Quest object


id - String

ID of the quest


name - String

Name of the quest


communityId - String

Your community ID


conditions - Array of object

List of conditions that define the user access to a quest. There are five types of conditions:

TypeDescriptionValueOperators

role

Compare a user discord role with the target value

Discord Role ID

=, !=

quest

Compare the IDs of the quests a user completed with the target value

Quest ID

isCompleted, isNotCompleted

date

Compare the current date with the target value

ISO string date

<, >

nft

Check if a user hold a NFT

Number of NFT the user should hold

No operators

level

Compare a user level with the target value

Number

<, >


conditionOperator - Enum (OR, AND)

This field defines the operator that is applied to link each condition. If it's AND, the user need to fulfill all the conditions to access the quest. If it's OR, fulfilling one condition is enough to access the quest.


recurrence - Enum (once, daily, weekly, monthly)

Defines how often a quest can be completed


retryAfter - Number

Number of seconds a user needs to wait after a quest has been failed


rewards - Array of objects

Rewards associated with a quest. There is 3 types of rewards:

TypeDescriptionValue

role

Discord role

Discord role ID

xp

XP of the quest

Number

other

Custom reward

String


tasks - Array of objects

This field contains the different tasks that compose the quest. You can learn more about the different types of tasks in our product documentation.


description - Object

TipTap document that describes the quest


autoValidate - Boolean

Boolean that defines if a quest requires a review or is automatically validated. The value of this field is automatically generated depending on the tasks that compose the quest.


deleted - Boolean

Defines if the quest is deleted


archived - Boolean

Defines if the quest is archived


published - Boolean

Defines if the quest is visible for the members


API Reference

List quests in a community

GEThttps://api-v2.zealy.io/public/communities/{subdomain}/quests
Path parameters
subdomain*string
Header parameters
Response

200

Body
description*nullable object
id*string
name*string
deletedboolean
communityIdstring
categoryIdstring
createdAtstring (date-time)
updatedAtstring (date-time)
archived*nullable boolean
autoValidateboolean
conditionOperator*nullable enum
ANDOR
conditions*array of object
published*boolean
recurrence*enum
dailyweeklymonthlyonce
retryAfter*nullable number
rewards*nullable array of object
tasks*array of all of
claimLimitnullable number
claimCounternullable number
Request
const response = await fetch('https://api-v2.zealy.io/public/communities/{subdomain}/quests', {
    method: 'GET',
    headers: {},
});
const data = await response.json();
Response
[
  {
    "description": {
      "type": "text",
      "text": "text",
      "attrs": {},
      "marks": [
        {
          "type": "text",
          "attrs": {
            "href": "text",
            "target": "_blank",
            "class": "text"
          }
        }
      ]
    },
    "id": "text",
    "name": "text",
    "deleted": false,
    "communityId": "text",
    "categoryId": "text",
    "createdAt": "2024-04-27T15:09:49.705Z",
    "updatedAt": "2024-04-27T15:09:49.705Z",
    "archived": false,
    "autoValidate": false,
    "conditionOperator": "AND",
    "conditions": [
      {
        "type": "level",
        "value": "text",
        "operator": "="
      }
    ],
    "published": false,
    "recurrence": "daily",
    "retryAfter": 0,
    "rewards": [
      {
        "type": "xp",
        "operator": "=",
        "value": "text",
        "chain": "polygon",
        "collection": "text",
        "contractAddress": "text"
      }
    ],
    "tasks": [
      {
        "id": "text",
        "type": "api",
        "settings": {
          "title": "text",
          "description": "text",
          "endpoint": "https://example.com",
          "apiKey": "text",
          "identifications": [
            "email"
          ]
        }
      }
    ],
    "claimLimit": 0,
    "claimCounter": 0
  }
]

Last updated