List surveys
List the surveys the community shows in this game that the connected player can answer now.
GET /v1/player/surveys · for player session
Use it to show the community's surveys inside the game: after a match, from a menu, or wherever a question fits. Send the player session as the bearer token. 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.
A survey is listed when the community's team switched on In game for it in Surveys & Forms, for this game or for every game, and:
- it is taking responses (open, not paused, not closed and under its response limit);
- it is open to the member: a survey limited to a role waits until CEEJAY can read the member's roles;
- the member has not finished it;
- for a survey that waits for a game event, the game has logged that event for the player, with Log player events, the number of times the team set since the survey opened;
- every required question is one a game can ask. A survey with a required member picker or file upload is answered in Discord and is not listed.
Query parameters
Prop
Type
Returns
data is a list of surveys, newest first. The response also includes page, with nextCursor and limit.
Prop
Type
Each question in questions contains:
Prop
Type
How to ask each type
type | What the game shows | What it sends |
|---|---|---|
text_short, text_long | A text box, one line or a paragraph | The text |
number, email, url | A text box for a number, an email address or a link | The text |
select_string, radio | One pick from options | The option's value |
checkbox | Several picks from options, between minChoices and maxChoices | A list of values |
rating | A row of scores, or stars when scale.icon is star, with scale.low and scale.high at the ends | The score's value |
nps | A row of scores from 0 to 10, with scale.low and scale.high at the ends | The score's value |
scale | Five opinions, from Strongly disagree to Strongly agree | The option's value |
yes_no | Two buttons, Yes and No | The option's value |
Paging
Pass page.nextCursor as cursor and stop when it is null. A survey can leave the list between two calls (it closed, or the player finished it), so key the list by the survey's id.
Example
curl "https://ceejay.communitystudios.xyz/api/v1/player/surveys?limit=10" \
-H "Authorization: Bearer $CEEJAY_PLAYER_SESSION"The TypeScript example uses connect.hub.listSurveys 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 full response below, with the list in data.
{
"success": true,
"data": [
{
"id": 41,
"title": "Tonight's playtest",
"description": "Three quick questions about the build you played.",
"questions": [
{
"key": "k_00000000000000a1",
"label": "How would you rate the build?",
"type": "rating",
"required": true,
"placeholder": null,
"description": null,
"options": [
{ "label": "1", "value": "1" },
{ "label": "2", "value": "2" },
{ "label": "3", "value": "3" },
{ "label": "4", "value": "4" },
{ "label": "5", "value": "5" }
],
"minLength": null,
"maxLength": null,
"minChoices": null,
"maxChoices": null,
"scale": { "low": "Poor", "high": "Great", "icon": "number" }
},
{
"key": "k_00000000000000a3",
"label": "What should we change?",
"type": "text_long",
"required": false,
"placeholder": null,
"description": null,
"options": [],
"minLength": null,
"maxLength": 1000,
"minChoices": null,
"maxChoices": null,
"scale": null
}
],
"closesAt": null,
"rewards": { "xp": 50, "roles": 0, "names": ["20 coins"] }
}
],
"page": { "nextCursor": null, "limit": 10 }
}Limits
120 reads a minute for one player session, shared by every request of the game loop that reads. 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
| Status | code | error | When |
|---|---|---|---|
400 | bad_request | limit must be a whole number from 1 to 100 | limit is above 100, negative, a fraction or text |
400 | bad_request | cursor is not one this list gave. Send page.nextCursor as it was answered | cursor is not a value this list returned |
401 | connection_ended | This connection has ended | The 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 |
409 | hub_not_enabled | This game does not show the community's quests, shop and rank | The game loop is disabled for the game |
409 | sharing_needed | The member has not consented to sharing their data with this game | The member has not consented, or must consent again. The body includes manageUrl: send the player there |
409 | membership_required | The member has to be in the server to use this | The Discord account is not in the server. The body includes membership and, for left and not_member, joinUrl |
503 | bot_unavailable | This could not be done right now and nothing was changed. Try again in a few seconds | CEEJAY's bot could not be reached or was too busy. The body includes retryAfter, in seconds |
504 | bot_timeout | The 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 repeat | The request timed out. Send it again |
Every error body also includes requestId. 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.

