すべてのエンドポイント

開発者向け / StrawPoll API / Polls

Change a poll

PATCH/polls/{id}

Changes what you send; everything else keeps its value. options replaces the list: options sent with their id keep their votes, labels without one are added, and options left out are removed with their votes. Meeting slots are matched by date and time. isOpen opens or closes voting, and status: published publishes a draft. A poll keeps its type, and image options are changed through PUT /forms/{slug}.

APIキーが必要です。

パラメーター

パス

  • id string 必須 max. 20

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

リクエストボディ application/json

  • title string max. 255
  • description string | null max. 2000
  • options array of string | object

    The new list. Send an option's id to keep its votes.

  • isOpen boolean

    Open or close voting.

  • status string

    指定できる値: draft published archived

  • allowMultiple boolean
  • allowOther boolean
  • requireNames boolean
  • resultsVisibility string

    指定できる値: public public_after_response public_after_close private

  • duplicateCheck string

    指定できる値: none session ip name email code

  • closesAt string (date-time) | null
  • timezone string

レスポンス

The changed poll.

  • id string

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

  • title string
  • description string
  • type string
    • multiple_choice: pick one option, or several with allowMultiple.
    • ranking: order the options; each place earns points.
    • ranked_choice: rank the options; an instant runoff finds the majority winner.
    • meeting: mark which dates and times work.

    指定できる値: multiple_choice ranking ranked_choice meeting

  • status string

    deleted and blocked are set by moderation; such forms cannot be changed.

    指定できる値: draft published archived deleted blocked

  • isOpen boolean
  • voteCount integer

    How many people voted.

  • options array of PollOption
  • otherAnswers array of object

    Answers voters added themselves, when allowOther is on.

  • winner string | null

    Ranked choice only.

  • tied array of string

    Ranked choice only; the options tied for the win.

  • rounds integer

    Ranked choice only.

  • settings PollSettings
  • urls PollUrls
  • createdAt string (date-time)
  • updatedAt string (date-time) | null

試してみる

キーを作成

ブラウザからAPIへ直接送られ、ほかには送られません。「記憶する」をオンにすると、このタブを閉じるまで保持されます。 読み取り専用キーなら、何も変更せずに試せます。

PATCH https://new.strawpoll.com/api/v4/polls/{id}

キーが必要なリクエストを送るには、APIキーを貼り付けてください。

キーを使ったリクエストは、プランの1日あたりのAPIリクエスト数に含まれます。