CEEJAYDocs

Answer a quest task

Submit the player's answer to a task whose action is answer or rate, and complete the task when the answer is correct.

POST /v1/player/quests/answer · for player session

Use it when the player types or picks an answer to a task whose action is answer or rate. CEEJAY validates it using the rules the Discord form uses: text must contain the required content and reach its minLength, a number must fall between min and max, and a rating must be a whole number from 1 to scale. The request needs the game loop. For the three conditions (game loop enabled for the game, member consent, server membership) and the error each returns, see What has to be true first.

Body parameters

Prop

Type

Returns

The response is the same as Verify a quest task: the quest completes when this was its last task, and rewards lists what it granted.

Prop

Type

Example

Request
curl -X POST https://ceejay.communitystudios.xyz/api/v1/player/quests/answer \
  -H "Authorization: Bearer $CEEJAY_PLAYER_SESSION" \
  -H "Content-Type: application/json" \
  -d '{
    "questId": 12,
    "taskId": 42,
    "answer": "Rugby Manager, every weekend"
  }'

The TypeScript example uses connect.hub.answerQuestTask from the Connect client in the TypeScript SDK. The player must be connected first: the client manages and refreshes the player session. It returns the data of the response below.

200 OK, a task done and tasks remain
{
  "success": true,
  "data": {
    "questId": 12,
    "taskId": 42,
    "verified": true,
    "questCompleted": false,
    "tasksDone": 2,
    "taskCount": 5,
    "rewards": null
  }
}

A wrong answer, and a bad one

An incorrect answer, such as text without the required content or a number the task does not accept, returns 409 with the code quest_task_not_done, and message says what is missing. An answer that is empty, too long, shorter than the task's minLength or outside the rating scale returns 400 with field: "answer". For text that is too short or a rating outside the scale, the message matches the Discord form's message.

A task that the community's team reviews is rejected before anything is written, with quest_task_unavailable and the reason not_for_games: a game never submits an answer for review. Repeating the request for a completed task returns already_done, so the request is safe to repeat and takes no key. CEEJAY does not send the member a direct message.

Limits

20 writes a minute for one player session, shared by Start, Verify and Answer a quest task, Buy a shop item, Claim an item and Check in. The three X-RateLimit headers report that count. Every request made with a player session also counts toward 140 a minute. See Rate limits. Over a limit the response is 429 with the code rate_limited, retryAfter and a Retry-After header.

Errors

StatuscodeerrorWhen
400bad_requestThe request body must be a JSON objectThe body is JSON but not an object: null, text, a number or a list. A body that is not JSON at all returns bad_request with the message The request body must be JSON
400bad_requestquestId must be a whole number from 1 to 2147483647questId is missing, is not a whole number, or is outside 1 to 2,147,483,647
400bad_requesttaskId must be a whole number from 1 to 2147483647taskId is not a whole number from 1 to 2,147,483,647
400bad_requestanswer is requiredanswer is missing, null or empty
400bad_requestanswer cannot be longer than 1000 charactersA text answer of more than 1,000 characters
400bad_requestWrite at least 10 characters.A text shorter than the task's minLength. The number comes from the task
400bad_requestPick a number from 1 to 5.A rating that is not a whole number from 1 to the task's scale. The number comes from the task
401connection_endedThis connection has endedThe connection or this device was ended since the player session was made. Discard the stored tokens and show the player as disconnected. See Renew a player session for the reasons
404quest_not_foundQuest not foundThe quest does not exist in this community, or the task is not one of its tasks
409hub_not_enabledThis game does not show the community's quests, shop and rankThe game loop is disabled for the game. Do not show the community's quests, shop or rank in the game
409sharing_neededThe member has not consented to sharing their data with this gameThe member has not consented to share their quests, rewards, shop and rank with the game, or must consent again. The body includes manageUrl: send the player there
409membership_requiredThe member has to be in the server to use thisThe Discord account is not in the server. The body includes membership (pending, left or not_member) and, for left and not_member, joinUrl, the URL to send the player to
409quest_not_activeQuest is not activeThe quest is not open
409quest_not_startedQuest has not started yetThe quest has not started yet
409quest_endedQuest has endedThe quest has ended
409quest_already_completedQuest already completed and is not repeatableThe player completed the quest and it cannot be repeated
409quest_limit_reachedMax completions per user reachedThe player completed the quest as many times as it allows
409quest_requires_roleThe member does not have the role this quest requiresThe member lacks the role the quest needs
409quest_requires_levelThe member has not reached the level this quest requiresThe member has not reached the level the quest needs
409quest_requires_season_xpThe member has not earned the season XP this quest requiresThe member has not earned the season XP the quest needs
409quest_requires_programThe member is not in the program this quest belongs toThe member is not in the program the quest belongs to
409quest_requires_questThe member has not completed the quest that comes before this oneThe quest that comes before this one is not done
409quest_fullQuest has reached its completion limitThe quest reached its overall completion limit
409quest_cooling_downThe member has to wait before completing this quest againThe player must wait before repeating the quest. The body includes availableAt
409quest_daily_limit_reachedThe member has reached this community's daily quest limitThe member reached the community's daily quest limit
409quest_task_not_doneThe task is not done yetThe answer is incorrect. message says what is missing
409quest_task_unavailableThis task cannot be done this way right nowThe task cannot be answered this way. The body includes reason: already_done, in_review, not_for_games, wrong_action or needs_connect, as on Verify a quest task, and platform for needs_connect
413body_too_largeThe request body is larger than 16 KBThe body is larger than 16 KB. Nothing was changed
503bot_unavailableThis could not be done right now and nothing was changed. Try again in a few secondsCEEJAY's bot could not be reached or was too busy, and nothing was changed. The body includes retryAfter, in seconds: retry after that many seconds
504bot_timeoutThe answer did not arrive in time, and the request may or may not have been done. Send the same request again: it is safe to repeatThe request timed out, so it is not known whether it was processed. Retry the same request: it is safe to repeat

Every error body also includes requestId, and a 400 with the code bad_request identifies the invalid field in field. Match on code; message text can change.

The errors every request of a game shares (the key, the state of the game, the origin, 405, 429, 500) are on the Errors page, and the errors specific to the game loop are under Codes of the game loop.

On this page

Community StudiosPrivacyTerms