Skip to main content
Use query getChallenges to implement different challenge listings:
  1. completed by the current API user;
  2. ongoing (the current date is between start and end dates, AND the challenge is not completed by the current API user yet);
  3. upcoming (the start date is in the future);
  4. all available challenges (except those ones that are finished and not completed by the current API user).
In a response it returns a list of Challenge objects that fit the applied filters. Results will be returned with the pagination and possibility to change the order and sorting key (default sorting is by the start date, ascending). The following arguments can be used in the query:
ArgumentTypeDescriptionDefault
afterCursorReturns results that come after the specified cursor. Should be used together with first parameter. Cannot be used if before is set.
beforeCursorReturns results that come before the specified cursor. Should be used together with last parameter. Cannot be used if after is set.
firstIntReturns up to the first N elements from the list. Required if after parameter is set. Cannot be used together with last.
lastIntReturns up to the first N elements from the list. Required if before parameter is set. Cannot be used together with first.
reverseBooleanAllows to reverse the order of the underlying list (default order is ascending).false
sortKeyChallengeSortKeyAllows to change the results sorting. Available options: START_DATE (default), END_DATESTART_DATE
statusChallengeStatusProvides the possibility to filter by the challenge status. Available options: COMPLETED, ONGOING, UPCOMING. Leave empty to get all available challenges; missed ones will be excluded from the results.
userContextIdIDThe user context ID to get the list of challenges for. If omitted, the results will be retrieved for the current API user context.
Here is an example of the query execution:
query getChallenges {
  getChallenges(first: 10, status: "COMPLETED") {
    edges {
      node {
        id
        title
        questionsNumber
        startDate
        endDate
        isRankingEnabled
        cta {
          actionId
          title
          arguments {
            key
            value
          }
        }
      }
    }
    totalItems
  }
}
The getChallenges query supports the same advanced features as other catalog queries: