First example

Ask two people how their visit went, with one link and no signup.

On this page

1. Ask

You need curl and jq. Set the API address, and make new files readable only by you, since one of them will hold the trial key:

Shell
export SESS_API="https://api.sess.si"
umask 077
Shell: write visit.json
cat > visit.json <<'JSON'
{
  "interaction": {
    "mode": "interactive",
    "title": "How was your visit?",
    "source": {
      "kind": "sess_surface",
      "components": [
        {
          "type": "field",
          "name": "visit",
          "label": "Your visit",
          "required": true,
          "rating": { "low": "Poor", "high": "Great" },
          "schema": { "type": "integer", "minimum": 1, "maximum": 5 }
        },
        {
          "type": "field",
          "name": "comment",
          "label": "Anything else?",
          "multiline": true,
          "schema": { "type": "string", "maxLength": 500 }
        }
      ]
    },
    "actions": [{ "id": "submit", "label": "Send", "intent": "submit" }]
  },
  "respondents": { "max": 2 }
}
JSON
Shell: create a trial Ask
curl -sS -X POST "$SESS_API/v1/trial/asks" \
  -H "Content-Type: application/json" \
  --data-binary @visit.json \
  -o ask.json -w '%{http_code}\n'
export ASK_ID="$(jq -r .id ask.json)"
export SESS_TRIAL_KEY="$(jq -r .management_credential ask.json)"
jq -r .human_url ask.json

Expected result: 201, then the link. ask.json holds the trial key, shown once. Keep it secret.

2. Answer twice

Open the link on your phone and answer. Then open it on this computer and answer again. Each browser gets its own page.

3. Read both answers

Shell: read the trial Ask
curl -sS "$SESS_API/v1/trial/asks/$ASK_ID" \
  -H "Authorization: Bearer $SESS_TRIAL_KEY" \
  | jq -c '[.sessions[].responses[].data]'
Expected output
[{"visit":5,"comment":"Lovely staff."},{"visit":4}]

A trial Ask is for at most 2 people. Creating it and each person's start count toward your network's 3 trials a day; see Limits.

With an API key, the same Ask takes up to your plan's limit: see the Quickstart.

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.