Quest Protocol
  • Introduction
    • Welcome to Quest Protocol
    • Integrate & Partner with Quest
    • Use Cases
      • Creator Platforms
      • Gaming
      • NFT Marketplaces
      • Social Media DApps
      • DeFi
  • QUEST PLATFORM
    • Creating a Campaign
    • Audience Overview
    • User Profile
    • Discover Page
    • Perk Store
    • Integrations
    • Memberships
    • Segmentation & Targetting
    • AI Insights
  • QUEST PROTOCOL - SDKs & APIs
    • UI SDK Components
      • Embedded XP Points
      • Embedded in-dApp Guides
      • Embedded Web3 Search
      • Embedded Quests
    • Quest SDKs & APIs
      • User
      • Entity
      • Badge
      • Campaign
      • App Metric
      • Membership Card
      • Entity Tag
      • Membership Tier
      • Skill
      • Entity Credit Tier
      • Gem
      • Custom Reward
      • Entity Gem
      • Entity Alert
      • Entity Feature Flag
      • Entity Data contract
      • Entity Authentication Token
      • Event Metric Mapping
    • Data Engine
  • Website
  • Quest Thesis
Powered by GitBook
On this page
  1. QUEST PROTOCOL - SDKs & APIs
  2. Quest SDKs & APIs

Campaign

PreviousBadgeNextApp Metric

Last updated 1 year ago

Get all campaigns

get

This endpoint retrieves all the active campaigns.

Query parameters
pagestringOptional

The page number of expected set of documents.

Example: 1
limitstringOptional

The limit of the number of documents each page.

Example: 10
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
Responses
200
Successful response
application/json
500
Server error
application/json
get
GET /api/quests HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
Accept: */*
{
  "success": true,
  "data": {
    "questId": "quest123",
    "entityId": "entity123",
    "eligibilityCriterias": [
      "criteria1",
      "criteria2"
    ],
    "rewards": [
      "reward1",
      "reward2"
    ],
    "title": "My campaign",
    "description": "This is my campaign description.",
    "imageURL": "https://example.com/campaign-image.jpg",
    "endsAt": "2023-06-30T23:59:59Z",
    "isDeleted": false,
    "hasReferral": false,
    "referralXP": 50,
    "visibility": "LIMITED",
    "status": "ACTIVE",
    "xp": 100,
    "skills": [
      {
        "skillId": "skill1",
        "score": 80
      },
      {
        "skillId": "skill2",
        "score": 60
      }
    ],
    "theme": {},
    "minXPThreshold": 50,
    "createdAt": "2023-06-27T12:45:00Z"
  }
}

Get all campaigns for an entity

get

This endpoint retrieves all the active campaigns of a specific entity.

Path parameters
entityIdstringRequired
Query parameters
pagestringOptional

The page number of expected set of documents.

Example: 1
limitstringOptional

The limit of the number of documents each page.

Example: 10
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
Responses
200
Successful response
application/json
500
Server error
application/json
get
GET /api/entities/{entityId}/quests HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
Accept: */*
{
  "success": true,
  "data": {
    "questId": "quest123",
    "entityId": "entity123",
    "eligibilityCriterias": [
      "criteria1",
      "criteria2"
    ],
    "rewards": [
      "reward1",
      "reward2"
    ],
    "title": "My campaign",
    "description": "This is my campaign description.",
    "imageURL": "https://example.com/campaign-image.jpg",
    "endsAt": "2023-06-30T23:59:59Z",
    "isDeleted": false,
    "hasReferral": false,
    "referralXP": 50,
    "visibility": "LIMITED",
    "status": "ACTIVE",
    "xp": 100,
    "skills": [
      {
        "skillId": "skill1",
        "score": 80
      },
      {
        "skillId": "skill2",
        "score": 60
      }
    ],
    "theme": {},
    "minXPThreshold": 50,
    "createdAt": "2023-06-27T12:45:00Z"
  }
}

Get campaign details

get

This endpoint retrieves the details of a specific campaign.

Path parameters
entityIdstringRequired
questIdstringRequired
Query parameters
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
Responses
200
Successful response
application/json
401
Unauthorized error
application/json
500
Server error
application/json
get
GET /api/entities/{entityId}/quests/{questId} HTTP/1.1
Host: api.questprotocol.xyz
userid: dummy-userid
token: dummy-token
apikey: test
Accept: */*
{
  "success": true,
  "data": {
    "questId": "quest123",
    "entityId": "entity123",
    "eligibilityCriterias": [
      "criteria1",
      "criteria2"
    ],
    "rewards": [
      "reward1",
      "reward2"
    ],
    "title": "My campaign",
    "description": "This is my campaign description.",
    "imageURL": "https://example.com/campaign-image.jpg",
    "endsAt": "2023-06-30T23:59:59Z",
    "isDeleted": false,
    "hasReferral": false,
    "referralXP": 50,
    "visibility": "LIMITED",
    "status": "ACTIVE",
    "xp": 100,
    "skills": [
      {
        "skillId": "skill1",
        "score": 80
      },
      {
        "skillId": "skill2",
        "score": 60
      }
    ],
    "theme": {},
    "minXPThreshold": 50,
    "createdAt": "2023-06-27T12:45:00Z"
  },
  "eligibilityData": [
    {
      "data": {
        "criteriaId": "criteria123",
        "questId": "quest123",
        "label": "Criteria Label",
        "xp": 50,
        "dependentCriterias": [
          "dependent1",
          "dependent2"
        ],
        "requiresApproval": true,
        "frequency": "DAILY",
        "metadata": {
          "key1": "value1",
          "key2": "value2"
        },
        "criteriaType": "TWITTER_LIKE_POST",
        "createdAt": "2023-06-27T12:45:00Z"
      },
      "completed": true,
      "isLocked": false,
      "unfinishedCriteriaIds": [
        "criteria1",
        "criteria2"
      ],
      "userAnswer": [
        "answer1",
        "answer2"
      ]
    }
  ],
  "allCriteriasCompleted": true,
  "claimStatus": true,
  "totalClaimed": 2,
  "rewards": [
    {
      "badgeId": "badge123",
      "entityId": "entity123",
      "badgeContractTokenId": "token123",
      "name": "My Badge",
      "imageIPFS": "https://example.com/badge-image.jpg",
      "description": "This is my badge description.",
      "xp": 100,
      "skills": [
        {
          "skillId": "skill1",
          "score": 80
        },
        {
          "skillId": "skill2",
          "score": 60
        }
      ],
      "isEnabled": true,
      "visibility": "LIMITED",
      "type": "DISCORD",
      "typeData": {
        "key1": "value1",
        "key2": "value2"
      },
      "proofType": "Type A",
      "endsAt": 1678900000,
      "remainingCount": 5,
      "createdBy": "user123",
      "createdAt": "2023-06-27T12:45:00Z"
    }
  ]
}

Get campaign summary

get

This endpoint retrieves the campaign summary.

Path parameters
entityIdstringRequired
questIdstringRequired
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
get
GET /api/entities/{entityId}/quests/{questId}/summary HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Accept: */*
{
  "success": true,
  "summary": {
    "quest": {
      "questId": "quest123",
      "entityId": "entity123",
      "eligibilityCriterias": [
        "criteria1",
        "criteria2"
      ],
      "rewards": [
        "reward1",
        "reward2"
      ],
      "title": "My campaign",
      "description": "This is my campaign description.",
      "imageURL": "https://example.com/campaign-image.jpg",
      "endsAt": "2023-06-30T23:59:59Z",
      "isDeleted": false,
      "hasReferral": false,
      "referralXP": 50,
      "visibility": "LIMITED",
      "status": "ACTIVE",
      "xp": 100,
      "skills": [
        {
          "skillId": "skill1",
          "score": 80
        },
        {
          "skillId": "skill2",
          "score": 60
        }
      ],
      "theme": {},
      "minXPThreshold": 50,
      "createdAt": "2023-06-27T12:45:00Z"
    },
    "answers": [
      {
        "question": "What is your name ?",
        "answers": [
          {
            "userAnswer": [
              "jon"
            ],
            "userId": "u-1234",
            "name": "Jon",
            "imageUrl": "image-ipfs-hash"
          }
        ]
      }
    ],
    "questStats": [
      {
        "viewCount": 10,
        "claimCount": 5,
        "date": "2023-06-27T12:45:00Z",
        "entityId": "e-101010",
        "questId": "q-101010",
        "createdAt": "2023-06-27T12:45:00Z",
        "updatedAt": "2023-06-27T12:45:00Z"
      }
    ]
  }
}

New referal code for campaign and user

get

This endpoint allows ato get or set a new refereal code associated with a campaign and user.

Path parameters
entityIdstringRequired
questIdstringRequired
userIdstringRequired
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
get
GET /api/entities/{entityId}/quests/{questId}/users/{userId}/referralcode HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Accept: */*
{
  "success": true,
  "referralCode": "referal-code"
}

Get Multiples Quests

get

This endpoint retreives multiple campaigns

Path parameters
entityIdstringRequired
Query parameters
userIdstringRequired
detailsPagestringOptional
pagenumberOptional
limitnumberOptional
selectedOptionstringOptional
getTopQuestbooleanOptional
sortByPrioritystringOptional
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
get
GET /api/entities/{entityId}/multiple-quests HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Accept: */*
{
  "success": true,
  "quests": [
    {
      "questId": "quest123",
      "entityId": "entity123",
      "eligibilityCriterias": [
        "criteria1",
        "criteria2"
      ],
      "rewards": [
        "reward1",
        "reward2"
      ],
      "title": "My campaign",
      "description": "This is my campaign description.",
      "imageURL": "https://example.com/campaign-image.jpg",
      "endsAt": "2023-06-30T23:59:59Z",
      "isDeleted": false,
      "hasReferral": false,
      "referralXP": 50,
      "visibility": "LIMITED",
      "status": "ACTIVE",
      "xp": 100,
      "skills": [
        {
          "skillId": "skill1",
          "score": 80
        },
        {
          "skillId": "skill2",
          "score": 60
        }
      ],
      "theme": {},
      "minXPThreshold": 50,
      "createdAt": "2023-06-27T12:45:00Z"
    }
  ],
  "page": 5,
  "totalPages": 25,
  "totalQuests": 100
}

Get referal leaderboard

get

This endpoint retrieves the referal leaderboard stats.

Path parameters
entityIdstringRequired
questIdstringRequired
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
get
GET /api/entities/{entityId}/quests/{questId}/referraldashboard HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Accept: */*
{
  "success": true,
  "data": {
    "userId": "user-123",
    "name": "jon-doe",
    "count": 10
  }
}

Get eligibility criteria for a quest

get

Retrieve eligibility criteria for a specific quest associated with an entity.

Path parameters
entityIdstringRequired

The ID of the entity.

questIdstringRequired

The ID of the quest.

Query parameters
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
tokenstringRequired

The token for user authentication.

Example: dummy-token
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
get
GET /api/entities/{entityId}/quests/{questId}/criterias HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Accept: */*
{
  "success": true,
  "data": {
    "questId": "quest-123",
    "entityId": "entity-456",
    "eligibilityCriterias": [
      "criteria-789"
    ],
    "rewards": [
      [
        "XP",
        "Badge"
      ]
    ],
    "title": "Explore the Unknown",
    "description": "Embark on a journey to discover hidden treasures.",
    "imageURL": "https://example.com/images/quest.png",
    "endsAt": "2023-12-31T23:59:59Z"
  }
}

Get quest submissions

get

This endpoint allows users to get submissions for a quest.

Path parameters
entityIdstringRequired
questIdstringRequired
Query parameters
parentEntityIdstringOptional
userIdstringOptional
pageinteger ยท min: 1OptionalDefault: 1
limitinteger ยท min: 1OptionalDefault: 10
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
get
GET /api/entities/{entityId}/quests/{questId}/submissions HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Accept: */*
{
  "success": true,
  "data": [
    {
      "decryptedEmail": "[email protected]",
      "usersReferred": 3,
      "referredBy": "[email protected]",
      "submittedAt": "2023-12-11T12:34:56Z",
      "userId": "123",
      "referralCode": "abc123"
    }
  ],
  "totalDocuments": 20,
  "totalPages": 2
}

Get quest answers

get

This endpoint allows users to get answers for a quest.

Path parameters
entityIdstringRequired
questIdstringRequired
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
get
GET /api/entities/{entityId}/quests/{questId}/answers HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Accept: */*
{
  "success": true,
  "data": {
    "answers": [
      {
        "userId": "123",
        "name": "John Doe",
        "imageUrl": "https://example.com/image.jpg",
        "session": "session123",
        "question1": "Answer 1",
        "question2": "Answer 2"
      }
    ],
    "questions": [
      "Question 1",
      "Question 2"
    ]
  }
}

Get new criteria session

get

This endpoint allows users to get a new session for eligibility criteria.

Path parameters
entityIdstringRequired
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
Responses
200
Successful response
application/json
401
Unauthorized error
application/json
500
Server error
application/json
get
GET /api/entities/{entityId}/new-session HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Accept: */*
{
  "success": true,
  "data": "1635869520123-123e4567-e89b-12d3-a456-426614174001"
}

Get details of a metric-based quest

get

Retrieves detailed information about a metric-based quest, including quest details, rewards, and user progress.

Path parameters
entityIdstringRequired
questIdstringRequired
Query parameters
userIdstringOptional
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
get
GET /api/entities/{entityId}/metric-quests/{questId} HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Accept: */*
{
  "success": true,
  "data": {
    "quest": {
      "questId": "text",
      "entityId": "text",
      "title": "text",
      "description": "text",
      "imageURL": "text",
      "endsAt": "text",
      "status": "text",
      "xp": 1,
      "skills": [
        {
          "name": "text",
          "skillId": "text",
          "score": 1
        }
      ]
    },
    "rewards": [
      {
        "rewardId": "text"
      }
    ],
    "progressPercent": 1,
    "metricDetails": {
      "metricId": "text",
      "entityId": "text",
      "metricType": "text",
      "threshold": 1,
      "autoClaimRewards": true,
      "repeatRewardsBasedOnMetricCount": true
    },
    "claimStatus": true
  }
}
  • GETGet all campaigns
  • GETGet all campaigns for an entity
  • POSTCreate campaign
  • GETGet campaign details
  • GETGet campaign summary
  • POSTUpdate campaign details
  • POSTDelete campaign
  • POSTVerify campaign criteria
  • POSTClaim campaign rewards
  • POSTClaim campaign rewards
  • GETNew referal code for campaign and user
  • GETGet Multiples Quests
  • POSTVerify multiple campaign criteria
  • GETGet referal leaderboard
  • GETGet eligibility criteria for a quest
  • POSTCreate Multiple Default Quests
  • POSTCreate a default quest for the entity
  • POSTSet the status of a quest
  • GETGet quest submissions
  • GETGet quest answers
  • GETGet new criteria session
  • POSTCreate metric quest
  • GETGet details of a metric-based quest

Create campaign

post

This endpoint allows to create a campaign.

Path parameters
entityIdstringRequired
Query parameters
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
tokenstringRequired

The token for user authentication.

Example: dummy-token
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
Body
titlestringRequiredExample: Title of this campaign
descriptionstringOptionalExample: Description of this campaign
imageURLstringOptionalExample: https://www.myimage.com
endsAtnumberOptionalExample: 72000
hasReferralbooleanOptionalExample: false
themeobjectOptional
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
post
POST /api/entities/{entityId}/quests HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
userid: dummy-userid
Content-Type: application/json
Accept: */*
Content-Length: 392

{
  "title": "Title of this campaign",
  "description": "Description of this campaign",
  "imageURL": "https://www.myimage.com",
  "endsAt": 72000,
  "hasReferral": false,
  "theme": {},
  "eligibilityCriterias": [
    {
      "type": "USER_INPUT_TEXT",
      "data": {
        "title": "Enter your name",
        "xp": 20,
        "frequency": "ONCE"
      }
    }
  ],
  "rewards": [
    {
      "type": "REWARD_BADGE",
      "title": "Dummy badge",
      "imageIPFS": "ipfs-hash",
      "description": "badge description"
    }
  ]
}
{
  "success": true,
  "qid": "campaign-202"
}

Update campaign details

post

This endpoint allows an admin to update a campaign.

Path parameters
entityIdstringRequired
questIdstringRequired
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
Body
titlestringOptionalExample: Title of this campaign
descriptionstringOptionalExample: Description of this campaign
imageURLstringOptionalExample: https://www.myimage.com
endsAtnumberOptionalExample: 72000
hasReferralbooleanOptionalExample: false
themeobjectOptional
rewardsobject[]OptionalExample: [{"type":"REWARD_BADGE","title":"Dummy badge","imageIPFS":"ipfs-hash","description":"badge description"}]
eligibilityCriteriaIdsToDeletestring[]OptionalExample: ec-101
rewardIdsToDeletestring[]OptionalExample: r-101
Responses
200
Successful response
application/json
401
Unauthorized error
application/json
500
Server error
application/json
post
POST /api/entities/{entityId}/quests/{questId}/update HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 466

{
  "title": "Title of this campaign",
  "description": "Description of this campaign",
  "imageURL": "https://www.myimage.com",
  "endsAt": 72000,
  "hasReferral": false,
  "theme": {},
  "eligibilityCriterias": [
    {
      "type": "USER_INPUT_TEXT",
      "data": {
        "title": "Enter your name",
        "xp": 20,
        "frequency": "ONCE"
      }
    }
  ],
  "rewards": [
    {
      "type": "REWARD_BADGE",
      "title": "Dummy badge",
      "imageIPFS": "ipfs-hash",
      "description": "badge description"
    }
  ],
  "eligibilityCriteriaIdsToDelete": [
    "ec-101"
  ],
  "rewardIdsToDelete": [
    "r-101"
  ]
}
{
  "success": true
}

Delete campaign

post

This endpoint allows an admin to delete a campaign.

Path parameters
entityIdstringRequired
questIdstringRequired
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
Body
objectOptional
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
post
POST /api/entities/{entityId}/quests/{questId}/delete HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 2

{}
{
  "success": true,
  "message": "Campaign deleted successfully"
}

Verify campaign criteria

post

This endpoint allows users to verify an eligibility criteria.

Path parameters
entityIdstringRequired
questIdstringRequired
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
Body
criteriaIdstringOptionalExample: criteria-123
answersstring[]OptionalExample: ["answer1","answer2"]
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
post
POST /api/entities/{entityId}/quests/{questId}/verify HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 61

{
  "criteriaId": "criteria-123",
  "answers": [
    "answer1",
    "answer2"
  ]
}
{
  "success": true
}

Claim campaign rewards

post

This endpoint allows a user to claim rewards.

Path parameters
entityIdstringRequired
questIdstringRequired
Query parameters
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
Body
userIdstringOptionalExample: user-123
referralCodestringOptionalExample: referal-code
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
post
POST /api/entities/{entityId}/quests/{questId}/claim HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 51

{
  "userId": "user-123",
  "referralCode": "referal-code"
}
{
  "success": true
}

Claim campaign rewards

post

This endpoint allows a user to claim rewards.

Path parameters
entityIdstringRequired
questIdstringRequired
Query parameters
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
referer;stringOptional
Body
userIdstringOptionalExample: user-123
referralCodestringOptionalExample: referal-code
questIdsstring[]Optional
addToDynamicNFTbooleanOptional
failedClaimsstring[]Optional
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
post
POST /api/entities/{entityId}/quests/{questId}/claim-multiple HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 118

{
  "userId": "user-123",
  "referralCode": "referal-code",
  "questIds": [
    "text"
  ],
  "addToDynamicNFT": true,
  "failedClaims": [
    "text"
  ]
}
{
  "success": true
}

Verify multiple campaign criteria

post

This endpoint allows users to verify an eligibility criteria.

Path parameters
entityIdstringRequired
questIdstringRequired
Query parameters
userIdstringRequired
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
Body
referralCodestringOptionalExample: xhy1245
userIdstringOptionalExample: 1
sessionstringOptional
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
post
POST /api/entities/{entityId}/quests/{questId}/verify-all HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 123

{
  "referralCode": "xhy1245",
  "criterias": [
    {
      "criteriaId": "exm-1233",
      "answer": [
        "option1",
        "option3"
      ]
    }
  ],
  "userId": "1",
  "session": ""
}
{
  "success": true,
  "failedCriterias": [
    "criteriasId1",
    "criteriasId2"
  ]
}

Create Multiple Default Quests

post

Create multiple default quests for a specified entity.

Path parameters
entityIdstringRequired

The ID of the entity for which quests are created.

Body
defaultIdsstring[]Optional
Responses
200
Success
application/json
400
Bad Request
application/json
401
Unauthorized error
application/json
500
Server error
application/json
post
POST /api/entities/{entityId}/default-multi-quest HTTP/1.1
Host: api.questprotocol.xyz
Content-Type: application/json
Accept: */*
Content-Length: 42

{
  "defaultIds": [
    "defaultId1",
    "defaultId2"
  ]
}
{
  "success": true,
  "data": [
    {
      "success": true,
      "id": "exm-id",
      "title": "title",
      "description": "description",
      "imageURL": "www.questlabs.ai",
      "endsAt": "text"
    }
  ]
}

Create a default quest for the entity

post

This endpoint allows users to create a default quest for the specified entity.

Path parameters
entityIdstringRequired

The ID of the entity for which the quest will be created.

Query parameters
userIdstringRequired

The Id of the user performing the request.

Example: dummy-userid
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
tokenstringRequired

The token for user authentication.

Example: dummy-token
Body
defaultIdstringRequired

The ID of the default quest (optional).

Example: default-id
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
post
POST /api/entities/{entityId}/default-quest HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 26

{
  "defaultId": "default-id"
}
{
  "success": true,
  "data": {
    "success": true,
    "id": "q-123"
  }
}

Set the status of a quest

post

This endpoint allows users to set the status of a quest.

Path parameters
entityIdstringRequired
questIdstringRequired
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
Body
statusstring ยท enumOptionalExample: ACTIVEPossible values:
Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
post
POST /api/entities/{entityId}/quests/{questId}/setstatus HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 19

{
  "status": "ACTIVE"
}
{
  "success": true
}

Create metric quest

post

This endpoint allows users to create a metric-based quest.

Path parameters
entityIdstringRequired
Header parameters
apikeystringRequired

The API key for authentication

Example: test
apisecretstringOptional

The secret key for authentication

Example: test-secret
useridstringRequired

The Id of the user performing the request.

Example: dummy-userid
tokenstringRequired

The token for user authentication.

Example: dummy-token
Body
titlestringOptional

Title of the quest

Example: exam-title
descriptionstringOptional

Description of the quest

Example: exam-desc
rewardsobject[]Optional
endsAtstringOptional

End date of the quest

autoClaimRewardsbooleanOptional

Auto claim rewards flag

repeatRewardsBasedOnMetricCountbooleanOptional

Repeat rewards based on metric count flag

metadataobjectOptional

Additional metadata for the quest

prioritynumberOptional

Priority of the quest (1-5)

Responses
200
Successful response
application/json
400
Client error
application/json
401
Unauthorized error
application/json
500
Server error
application/json
post
POST /api/entities/{entityId}/metric-quests HTTP/1.1
Host: api.questprotocol.xyz
apikey: test
userid: dummy-userid
token: dummy-token
Content-Type: application/json
Accept: */*
Content-Length: 300

{
  "title": "exam-title",
  "description": "exam-desc",
  "metric": {
    "metricId": "text",
    "metricType": "threshold",
    "threshold": 1,
    "autoClaimRewards": true,
    "repeatRewardsBasedOnMetricCount": true
  },
  "rewards": [
    {}
  ],
  "endsAt": "text",
  "autoClaimRewards": true,
  "repeatRewardsBasedOnMetricCount": true,
  "metadata": {},
  "priority": 1
}
{
  "success": true,
  "questId": "q-123e4567-e89b-12d3-a456-426614174000"
}