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, and jq to pick fields out of JSON.
  • The API base URL: https://api.sess.si.
Shell
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.

Shell: write class.json
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
Shell: create the Ask
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

Shell: 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

Shell: read the Ask
curl -sS "$SESS_API/v1/asks/$ASK_ID" \
  -H "Authorization: Bearer $SESS_API_KEY" \
  | jq -c '{status, started: .counts.started, answers: [.sessions[].responses[].data]}'
Expected output, after one person answered
{"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

Was this page useful?

Tell us more

Thanks for telling us.

You’ve sent a lot of answers in the last hour. Please try again later.

This couldn’t be sent right now. Please try again later.

That didn’t go through. Keep your note under 280 characters and send it again.

No account needed. We keep your answer, your note and this page’s address for a year, with a one-way code of your network address to stop abuse. Please leave out personal details.