GET/api/v1/boshu/drafts/context
「BOSHU の外部 API」の分類の、情報を読み出す API。ログインした本人として呼ぶ。
- 要約
下書き投入の前提: 募集を作れる主体・紐づくイベント(null = 紐づかない)・テンプレートと既定の質問/対象/入力設定/主体の制限(partner=イベントのパートナーBOSHU)・上限
- 呼び方と印
ログイン・レート制限
短い時間に呼びすぎると断られる API(レート制限)。断られたら Retry-After の秒数を待って呼び直す。
返るもの(応答)200 · application/json
成功したときに返る形。入れ子の欄は、その行を押すと開く・閉じる。「任意」の印がある欄は返らないことがある。
callerobjectidstring(uuid)staffRolestringcredential"token" | "session"
subjectsarray<object>件数 ≤200kindenum(5)"platform" "event" "guild" "venture" "person"idstring(uuid) | nullnamestringeventIdstring(uuid) | nullapprovalRequiredbooleantargetsarray<object>件数 ≤50contentIdstring(uuid) | nullsessionIdstring(uuid) | nullkindstring | nulllabelstring
eventsarray<object>idstring(uuid)namestring
standaloneAllowedbooleantemplatesarray<object>keystringlabelstringhintstringkind"staff" | "talk" | "pitch" | "other"profilePolicy"kind" | "required" | "basic"defaultApplicantKind"individual" | "guild" | "venture"defaultDescriptionstring | nulldefaultQuestionsarray<object>idstringtypeenum(9)"short" "long" "single" "multi" "check" "url" "date" "image" "document"labelstringhelpstring | nullrequiredbooleanoptionsarray<object>idstringlabelstring
sensitivebooleanmaxLength任意integercondition任意objectquestionIdstringoptionIdstring
enabled任意booleansection任意stringorganizationField任意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"min1max3
defaultMessagePolicy任意"legacy" | "required" | "optional" | "off"defaultAudience任意"all" | "student" | "professional"allowedOwnerKinds任意array<enum(5)>
kindsarray<"staff" | "talk" | "pitch" | "other">questionTypesarray<enum(9)>limitsrecord<number>publication"draft_only"
失敗したとき(エラー)
失敗したときの状態コードと、その意味。本文の error の値で、プログラムが失敗の種類を見分けられる。
- 400入力の誤り(error = invalid_input など)
- 401未ログイン(unauthorized)/ Bearer が無効(invalid_token。WWW-Authenticate 付き)
- 403HTTP 403(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
- partner_owner_not_allowed
- partner_applicant_kind
呼び出しの見本
そのまま試せる呼び出しの例。curl と fetch をタブで切り替える。ID やトークンは自分の値に置き換える。
curl "https://bounty.spikes.4s.link/api/v1/boshu/drafts/context" \
-H "Authorization: Bearer $BEARER_AUTH"