POST/api/v1/boshu/drafts/from-modules
「BOSHU の外部 API」の分類の、新しく作る、または操作を実行するために内容を送る API。ログインした本人として呼ぶ。
- 要約
質問の無い募集の下書きを作り、同じ transaction でモジュールの操作を当てる(sourceKey・idempotencyKey。常に下書き)
- 呼び方と印
ログイン・レート制限
短い時間に呼びすぎると断られる API(レート制限)。断られたら Retry-After の秒数を待って呼び直す。
送るもの(本文)application/json
送る本文の欄。「必須」の印がある欄は省けない。
sourceKey必須string/^[A-Za-z0-9][A-Za-z0-9_.:-]{0,63}$/subject必須object | object | object|1必須objectkind必須"platform"|2必須objectkind必須"person"|3必須objectkind必須"event" | "guild" | "venture"id必須string(uuid)eventId必須string(uuid) | nullcall必須objectsignupPolicy任意"required" | "optional"ticketOffer任意booleangroupSubmissionPolicy任意"managers" | "confirmed_members"defaultMailPreviewHash任意string/^[a-f0-9]{64}$/applicantKind必須"individual" | "guild" | "venture"template必須enum(10) | null- "member"
- "talk"
- "pitch"
- "hackathon"
- "student_guild"
- "student_venture"
- "guild_royale"
- "creative_blitz"
- "open_meeting"
- "partner"
profilePolicy必須"kind" | "required" | "basic"portfolioRequired必須booleanmessagePolicy必須"legacy" | "required" | "optional" | "off"applicationFields任意object | nullheadline任意objectenabled必須booleanrequired必須booleanlabel必須string長さ 1–120placeholder必須string長さ ≤200message任意objectenabled必須booleanrequired必須booleanlabel必須string長さ 1–120placeholder必須string長さ ≤200links任意objectenabled必須booleanrequired必須booleanlabel必須string長さ 1–120placeholder必須string長さ ≤200portfolio任意objectenabled必須booleanrequired必須booleanlabel必須string長さ 1–120placeholder必須string長さ ≤200contentId必須string(uuid) | nullkeyVisualUploadId任意string(uuid) | nullaudience任意"all" | "student" | "professional"既定 "all"kind必須"staff" | "talk" | "pitch" | "other"title必須string長さ 1–60description任意string | null長さ ≤2000requirements任意string | null長さ ≤600sessionId任意string(uuid) | nullcapacity必須integer | null1–500talkMinutes任意integer | null1–120opensAt必須stringclosesAt必須stringmode任意"review" | "first_come"既定 "review"paid任意boolean既定 falsecompensation任意string | null長さ ≤120ribbonLabel任意string | null長さ ≤16coManagerUserIds任意array<string(uuid)>件数 ≤10 · 既定 []idempotencyKey必須string/^[A-Za-z0-9][A-Za-z0-9_.:-]{15,99}$/template任意enum(10)- "member"
- "talk"
- "pitch"
- "hackathon"
- "student_guild"
- "student_venture"
- "guild_royale"
- "creative_blitz"
- "open_meeting"
- "partner"
operations任意array<object | object | object | object | object | object | object | object>件数 ≤20|1必須objectop必須"place"moduleId必須string(uuid)at任意integer0–20|2必須objectop必須"add_inline"body必須objecttitle必須string長さ 1–80help任意string | null長さ ≤400questions必須array<object>件数 ≤60id必須string/^q_[a-z0-9]{4,24}$/type必須enum(9)- "short"
- "long"
- "single"
- "multi"
- "check"
- "url"
- "date"
- "image"
- "document"
label必須string長さ 1–120help任意string | null長さ ≤1000required任意boolean既定 falseenabled任意booleanoptions任意array<object>件数 ≤20 · 既定 []sensitive任意boolean既定 falsemaxLength任意integer1–2000section任意string長さ 1–80organizationField任意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任意objectkind必須"active_student"min必須1max必須3condition任意objectquestionId必須string/^q_[a-z0-9]{4,24}$/optionId必須string/^o_[a-z0-9]{1,24}$/at任意integer0–20|3必須objectop必須"edit_inline"refId必須string長さ 1–40body必須objecttitle必須string長さ 1–80help任意string | null長さ ≤400questions必須array<object>件数 ≤60id必須string/^q_[a-z0-9]{4,24}$/type必須enum(9)- "short"
- "long"
- "single"
- "multi"
- "check"
- "url"
- "date"
- "image"
- "document"
label必須string長さ 1–120help任意string | null長さ ≤1000required任意boolean既定 falseenabled任意booleanoptions任意array<object>件数 ≤20 · 既定 []sensitive任意boolean既定 falsemaxLength任意integer1–2000section任意string長さ 1–80organizationField任意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任意objectkind必須"active_student"min必須1max必須3condition任意objectquestionId必須string/^q_[a-z0-9]{4,24}$/optionId必須string/^o_[a-z0-9]{1,24}$/|4必須objectop必須"fork"refId必須string長さ 1–40body任意objecttitle必須string長さ 1–80help任意string | null長さ ≤400questions必須array<object>件数 ≤60id必須string/^q_[a-z0-9]{4,24}$/type必須enum(9)- "short"
- "long"
- "single"
- "multi"
- "check"
- "url"
- "date"
- "image"
- "document"
label必須string長さ 1–120help任意string | null長さ ≤1000required任意boolean既定 falseenabled任意booleanoptions任意array<object>件数 ≤20 · 既定 []sensitive任意boolean既定 falsemaxLength任意integer1–2000section任意string長さ 1–80organizationField任意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任意objectkind必須"active_student"min必須1max必須3condition任意objectquestionId必須string/^q_[a-z0-9]{4,24}$/optionId必須string/^o_[a-z0-9]{1,24}$/|5必須objectop必須"refresh"refId必須string長さ 1–40|6必須objectop必須"remove"refId必須string長さ 1–40|7必須objectop必須"shelve"refId必須string長さ 1–40key必須string/^m_[a-z0-9_]{2,40}$/platform必須booleanalsoTickets必須boolean|8必須objectop必須"split"refId必須string長さ 1–40parts必須array<object>件数 2–20title必須string長さ 1–80help任意string | null長さ ≤400questionIds必須array<string>件数 1–30
返るもの(応答)200 · application/json
成功したときに返る形。入れ子の欄は、その行を押すと開く・閉じる。「任意」の印がある欄は返らないことがある。
idstring(uuid)sourceKeystringstatus"draft"publication"draft_only"createdbooleanreplayedbooleanquestionnaireobjectcallIdstring(uuid)titlestringstatus"draft" | "published" | "closed"approval"not_required" | "pending" | "approved" | "rejected"policy"all_operations" | "no_new_version"versioninteger | nullhashstring/^[0-9a-f]{64}$/pageobjectidstringdestinationstringplacementstringtitlestringmodulesarray<object | object>|1objectkind"shared"idstringmoduleIdstringpinned任意objectrevisionintegerbodyobjecttitlestringhelpstring | nullquestionsarray<object>
|2objectkind"inline" | "legacy"idstringbodyobjecttitlestringhelpstring | nullquestionsarray<object>
placedarray<object>refIdstringmoduleIdstringrevisioninteger | nullshelfRevisioninteger | nulloutdatedbooleanarchivedboolean
applicationCountinteger≥0shelveTargetsobjecteventbooleanplatformboolean
失敗したとき(エラー)
失敗したときの状態コードと、その意味。本文の error の値で、プログラムが失敗の種類を見分けられる。
- 400HTTP 400(x-bounty-error-codes を参照)
- 401未ログイン(unauthorized)/ Bearer が無効(invalid_token。WWW-Authenticate 付き)
- 403HTTP 403(x-bounty-error-codes を参照)
- 404HTTP 404(x-bounty-error-codes を参照)
- 409HTTP 409(x-bounty-error-codes を参照)
- 413HTTP 413(x-bounty-error-codes を参照)
- 422HTTP 422(x-bounty-error-codes を参照)
- 428HTTP 428(x-bounty-error-codes を参照)
- 429レート制限(Retry-After 付き)
- 503HTTP 503(x-bounty-error-codes を参照)
- invalid_token
- forbidden
- consent_required
- rate_limited
- invalid_input
- call_not_found
- revision_conflict
- published_call_new_version
- questionnaire_invalid
- module_not_found
- module_ref_not_found
- module_already_placed
- too_many_modules
- module_not_shared
- module_is_shared
- module_already_shared
- module_key_taken
- module_invalid
- shelf_unavailable
- member_selection_requires_organization
- event_link_mismatch
- owner_not_found
- idempotency_conflict
- draft_quota_exceeded
- feature_disabled
- co_manager_forbidden
- account_not_found
呼び出しの見本
そのまま試せる呼び出しの例。curl と fetch をタブで切り替える。ID やトークンは自分の値に置き換える。
curl -X POST "https://bounty.spikes.4s.link/api/v1/boshu/drafts/from-modules" \
-H "Authorization: Bearer $BEARER_AUTH" \
-H "Content-Type: application/json" \
-d '{
"sourceKey": "string",
"subject": {
"kind": "platform"
},
"eventId": "00000000-0000-4000-8000-000000000000",
"call": {
"applicantKind": "individual",
"template": "member",
"profilePolicy": "kind",
"portfolioRequired": false,
"messagePolicy": "legacy",
"contentId": "00000000-0000-4000-8000-000000000000",
"kind": "staff",
"title": "string",
"capacity": 1,
"opensAt": "string",
"closesAt": "string"
},
"idempotencyKey": "string"
}'