本文へ移動
Bounty Developer

PUT/api/boshu/calls/{id}/questionnaire

「BOSHU の管理」の分類の、送った内容で対象を保存する(更新する)API。ログインした本人として呼ぶ。

要約

募集の設問のページを保存する(保存 = 版。写しが変わらなければ版を足さない。承認のやり直しは質問の保存と同じ)

呼び方と印

ログイン

URL に付ける値(パラメータ)

経路の中の波かっこの部分と、URL の ? の後ろに付ける値。「必須」の印があるものは省けない。

  • idpath必須string(uuid)

送るもの(本文)application/json

送る本文の欄。「必須」の印がある欄は省けない。

  • page必須object
  • id必須"p_boshu"
  • destination必須"boshu_call"
  • placement必須"submit"
  • title必須string
    長さ 1–80
  • modules必須array<object | object | object>
    件数 ≤20
  • |1必須object
  • kind必須"shared"
  • id必須string
    /^mr_[a-z0-9]{4,24}$/
  • moduleId必須string(uuid)
  • pinned任意any
  • |2必須object
  • kind必須"inline"
  • id必須string
    /^mr_[a-z0-9]{4,24}$/
  • body必須object
  • title必須string
    長さ 1–80
  • help任意string | null
    長さ ≤400
  • questions必須array<any>
    件数 1–30
  • |3必須object
  • kind必須"legacy"
  • id必須"mr_legacy"
  • body必須object
  • title必須string
    長さ 1–80
  • help任意string | null
    長さ ≤400
  • questions必須array<object>
    件数 ≤60
  • id必須string
    /^q_[a-z0-9]{4,24}$/
  • type必須enum(9)
    • "short"
    • "long"
    • "single"
    • "multi"
    • "check"
    • "url"
    • "date"
    • "image"
    • "document"
  • label必須string
    長さ 1–120
  • help任意string | null
    長さ ≤1000
  • required任意boolean
    既定 false
  • enabled任意boolean
  • options任意array<object>
    件数 ≤20 · 既定 []
  • sensitive任意boolean
    既定 false
  • maxLength任意integer
    1–2000
  • section任意string
    長さ 1–80
  • organizationField任意enum(11)
    • "name"
    • "nameKana"
    • "organizationType"
    • "baseUniversities"
    • "foundedYearMonth"
    • "memberCount"
    • "studentMemberCount"
    • "genres"
    • "links"
    • "catchphrase"
    • "activitySummary"
  • profileField任意enum(9)
    • "displayName"
    • "title"
    • "orgName"
    • "schoolName"
    • "gradYear"
    • "organizations"
    • "faculty"
    • "standing"
    • "grade"
  • memberSelection任意object
  • condition任意object
  • expectedVersion任意integer | null
    ≥0

返るもの(応答)200 · application/json

成功したときに返る形。入れ子の欄は、その行を押すと開く・閉じる。「任意」の印がある欄は返らないことがある。

  • versioninteger
  • changedboolean
  • reapprovedboolean
  • pendingReviewboolean
  • questionnaireobject
    • callIdstring(uuid)
    • versioninteger | null
    • pageobject
      • idstring
      • destinationstring
      • placementstring
      • titlestring
      • modulesarray<object | object>
        • |1object
          • kind"shared"
          • idstring
          • moduleIdstring
          • pinned任意object
            • revisioninteger
            • bodyobject
              • titlestring
              • helpstring | null
              • questionsarray<object>
        • |2object
          • kind"inline" | "legacy"
          • idstring
          • bodyobject
            • titlestring
            • helpstring | null
            • questionsarray<object>
    • placedarray<object>
      • refIdstring
      • moduleIdstring
      • revisioninteger | null
      • shelfRevisioninteger | null
      • outdatedboolean
      • archivedboolean
    • shelfarray<object>
      • idstring
      • keystring
      • eventIdstring | null
      • destinationsarray<string>
      • revisioninteger
      • bodyobject
        • titlestring
        • helpstring | null
        • questionsarray<object>
          • idstring
          • typestring
          • labelstring
      • archivedAt任意string | null
      • placedboolean
      • canEditboolean

失敗したとき(エラー)

失敗したときの状態コードと、その意味。本文の error の値で、プログラムが失敗の種類を見分けられる。

  • 400入力の誤り(error = invalid_input など)
  • 401未ログイン(unauthorized)/ Bearer が無効(invalid_token。WWW-Authenticate 付き)
  • 403権限が無い
  • 409HTTP 409(x-bounty-error-codes を参照)
  • 422HTTP 422(x-bounty-error-codes を参照)
  • questions_changed
  • call_not_found
  • invalid_input
  • manager_reverify_required
  • questionnaire_invalid
  • creative_questions_required
  • member_selection_requires_organization

呼び出しの見本

そのまま試せる呼び出しの例。curl と fetch をタブで切り替える。ID やトークンは自分の値に置き換える。

curl -X PUT "https://bounty.spikes.4s.link/api/boshu/calls/{id}/questionnaire" \
  -H "Authorization: Bearer $BEARER_AUTH" \
  -H "Content-Type: application/json" \
  -d '{
    "page": {
      "id": "p_boshu",
      "destination": "boshu_call",
      "placement": "submit",
      "title": "string",
      "modules": []
    }
  }'
PUT /api/boshu/calls/{id}/questionnaire | Bounty Developer