People
Ask many people with one link. Each person who opens it gets their own page, and your agent reads every answer with one call. How the rules work.
On this page
Before you start
- An API key,
curl, andjqto pick fields out of JSON. - The API base URL:
https://api.sess.si.
export SESS_API="https://api.sess.si"
read -rs SESS_API_KEY && export SESS_API_KEY # paste the key, then press Enter
1. Create the Ask
Write the question once. respondents.max is how many people may start.
respondents.max is at least 2 and at most your plan's active-Session limit; a number out of range fails with 400 INVALID_SCHEMA, whose message names both bounds. "name": true in respondents adds one required "Your name" field before the page's first field; it is off by default (false). expires_in is the Ask's one deadline; without it, the Ask lasts your plan's link lifetime.
cat > class.json <<'JSON'
{
"interaction": {
"mode": "interactive",
"title": "End of class check",
"source": {
"kind": "sess_surface",
"components": [
{
"type": "field",
"name": "clarity",
"label": "How clear was today’s lesson?",
"required": true,
"rating": {},
"schema": { "type": "integer", "minimum": 1, "maximum": 5 }
}
]
},
"actions": [{ "id": "submit", "label": "Send", "intent": "submit" }]
},
"respondents": { "max": 20 }
}
JSON
curl -sS -X POST "$SESS_API/v1/asks" \
-H "Authorization: Bearer $SESS_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @class.json \
-o ask.json -w '%{http_code}\n'
export ASK_ID="$(jq -r .id ask.json)"
Expected result: 201.
2. Share the link
jq -r .human_url ask.json
Share this link with everyone who should answer. Each person gets their own page.
The cap is exact: it is checked when a person starts, so it cannot be overshot.
3. Read the answers
curl -sS "$SESS_API/v1/asks/$ASK_ID" \
-H "Authorization: Bearer $SESS_API_KEY" \
| jq -c '{status, started: .counts.started, answers: [.sessions[].responses[].data]}'
{"status":"open","started":1,"answers":[{"clarity":5}]}
Each entry in sessions is one respondent, with their own answers. A respondent is a browser, not a person.
The Ask closes by itself when the last place is taken or its deadline passes. To close it sooner, see Ask a group.
Where next
- First example: two people, no signup.
- Asks in the API reference: every option and error.