모든 엔드포인트

개발자 / StrawPoll API / Voting

Change a response

PUT/forms/{slug}/submit

Changes a response sent earlier from the same browser, when the form lets respondents edit their own. On meeting polls the organizer (also with a key) and, where the poll allows it, other visitors may change someone else's meeting answers.

브라우저에서는 API 키 없이 작동하며, 스크립트는 키를 보냅니다.

매개변수

경로

  • slug string 필수 max. 20

    The form's public id, as in https://strawpoll.com/r/{slug}.

요청 본문 application/json

  • fields object 필수

    Answers keyed by field id:

    • choice and picture questions: list of choice ids, plus at most one free-text string when write-ins are allowed;
    • ranking: every choice id, best first;
    • meeting: per date field, a list of { "choiceId", "status" } with status yes, if_need_be or no;
    • yes_no: "yes" or "no"; rating and scale: the number as a string;
    • text, email and contact fields: a string.
  • name string max. 255

    The respondent's name, used when the form has no contact name question. Needed with responseDuplicateCheck name.

  • email string (email)

    Ignored. The email comes from the form's email question, a verified address (see /verify) or the invite.

  • comment string

    Ignored. Comments go to the form's discussion now, apart from the response.

  • code string

    Unique code or invite code.

  • captchaToken string
  • voteToken string

    Required without an API key: the token the voting page got, or one from GET /forms/{slug}/vote-token. Each takes one response.

  • automated boolean

    The browser reports automation (navigator.webdriver); such a vote needs the captcha.

  • hidden object

    Values of the form's hidden fields by name, such as utm_source; at most 500 characters each.

  • timeUp boolean

    Timed quizzes; sent when the time ran out, so unanswered questions score nothing.

  • secret boolean

    Send true when you told the respondent their response is secret. It is then only saved while the form is a secret ballot (responsesVisibility: secret), and refused with not_secret otherwise.

  • additional boolean

    Meeting polls; add another person's vote from the same browser.

  • participants boolean

    Send false to leave participants and word clouds out of the reply, which is faster on big forms.

    기본값: true

  • id string (uuid) 필수

응답

The changed response's id, and the responses the voter may now see.

  • id string (uuid)
  • participants array of Participant
  • partial boolean
  • wordClouds object
  • quiz object | null

직접 해 보기

키 만들기

브라우저에서 API로만 직접 전송됩니다. ‘기억하기’를 켜면 이 탭을 닫을 때까지 유지됩니다. 읽기 전용 키를 쓰면 아무것도 바꾸지 않고 둘러볼 수 있습니다.

PUT https://new.strawpoll.com/api/v4/forms/{slug}/submit

키를 사용한 요청은 요금제의 일일 API 요청 수에 포함됩니다.