PUT/api/events/{slug}/manage/form-modules/{moduleId}
「イベント」の分類の、送った内容で対象を保存する(更新する)API。ログインした本人として呼ぶ。
- 要約
共通モジュールを直す(revision が 1 増える。公開済みの設問は変わらない)
- 呼び方と印
ログイン
URL に付ける値(パラメータ)
経路の中の波かっこの部分と、URL の ? の後ろに付ける値。「必須」の印があるものは省けない。
slugpath必須stringmoduleIdpath必須string(uuid)
送るもの(本文)application/json
送る本文の欄。「必須」の印がある欄は省けない。
key必須string/^m_[a-z0-9_]{2,40}$/platform任意boolean既定 falsedestinations必須array<"fours_common" | "bounty_profile" | "bounty_event" | "boshu_call">件数 1–4body必須objecttitle必須string長さ 1–80help任意string | null長さ ≤400questions必須array<any>件数 1–30expectedRevision任意integer≥1
返るもの(応答)200 · application/json
成功したときに返る形。入れ子の欄は、その行を押すと開く・閉じる。「任意」の印がある欄は返らないことがある。
moduleobjectidstring(uuid)keystring/^m_[a-z0-9_]{2,40}$/eventIdstring(uuid) | nulldestinationsarray<"fours_common" | "bounty_profile" | "bounty_event">件数 ≥1revisioninteger≥1bodyobjecttitlestring長さ 1–80helpanyquestionsarray<any>件数 1–30
archivedAt任意string | null
失敗したとき(エラー)
失敗したときの状態コードと、その意味。本文の 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 を参照)
- event_not_found
- feature_disabled
- forbidden
- manager_reverify_required
- human_action_required
- invalid_input
- module_not_found
- module_invalid
- module_key_taken
- module_changed
呼び出しの見本
そのまま試せる呼び出しの例。curl と fetch をタブで切り替える。ID やトークンは自分の値に置き換える。
curl -X PUT "https://bounty.spikes.4s.link/api/events/{slug}/manage/form-modules/{moduleId}" \
-H "Authorization: Bearer $BEARER_AUTH" \
-H "Content-Type: application/json" \
-d '{
"key": "string",
"destinations": [
"fours_common"
],
"body": {
"title": "string",
"questions": [
null
]
}
}'