POST/api/participation-visual/events/{eventId}/preview
「コンテンツ企画」の分類の、新しく作る、または操作を実行するために内容を送る API。ログインした本人として呼ぶ。
- 要約
固定の合成人物で PNG と問題を返す(実参加者は読まない)
- 呼び方と印
ログイン・レート制限
短い時間に呼びすぎると断られる API(レート制限)。断られたら Retry-After の秒数を待って呼び直す。
URL に付ける値(パラメータ)
経路の中の波かっこの部分と、URL の ? の後ろに付ける値。「必須」の印があるものは省けない。
eventIdpath必須string(uuid)
送るもの(本文)application/json
送る本文の欄。「必須」の印がある欄は省けない。
expectedRevision必須integer≥0purpose必須"participation" | "wanted"draft任意objectversion必須1width必須1414height必須2000purposes必須objectparticipation必須objectbackground必須object | object | object|1必須objectkind必須"builtin"key必須enum(5)- "tokyo-portrait"
- "tokyo-assemble-pass-v7"
- "tokyo-assemble-pass-v7-tight"
- "tokyo-assemble-pass-v7-beams"
- "wanted-paper"
|2必須objectkind必須"image"imageId必須string(uuid)|3必須objectkind必須"solid"color必須string/^#[0-9a-fA-F]{6}$/layers必須array<object | object | object | object>件数 1–32|1必須objectid必須string/^[a-zA-Z0-9_-]{1,40}$/x必須number0–1y必須number0–1width必須number0.0007072135785007072–1height必須number0.0005–1kind必須"avatar"shape必須"rect" | "circle"radius必須number0–0.5tilt任意"forward"|2必須objectid必須string/^[a-zA-Z0-9_-]{1,40}$/x必須number0–1y必須number0–1width必須number0.0007072135785007072–1height必須number0.0005–1kind必須"rect"color必須string/^#[0-9a-fA-F]{6}$/opacity必須number0–1radius必須number0–0.5gradient任意string/^#[0-9a-fA-F]{6}$/tilt任意"forward"requires任意enum(6)- "name"
- "title"
- "university"
- "needs"
- "eventTitle"
- "hashtag"
|3必須objectid必須string/^[a-zA-Z0-9_-]{1,40}$/x必須number0–1y必須number0–1width必須number0.0007072135785007072–1height必須number0.0005–1kind必須"logo"key必須"spikes-symbol" | "spikes-wordmark" | "spikes-vertical"opacity必須number0–1|4必須objectid必須string/^[a-zA-Z0-9_-]{1,40}$/x必須number0–1y必須number0–1width必須number0.0007072135785007072–1height必須number0.0005–1kind必須"text"binding必須enum(6) | null- "name"
- "title"
- "university"
- "needs"
- "eventTitle"
- "hashtag"
text必須string長さ ≤200color必須string/^#[0-9a-fA-F]{6}$/font必須"sans" | "display" | "wanted"fontSize必須integer16–300weight必須400 | 700align必須"left" | "center" | "right"maxLines必須integer1–8shadow任意objectcolor必須string/^#[0-9a-fA-F]{6}$/x必須integer-16–16y必須integer-16–16blur必須integer0–32tilt任意"forward"requires任意enum(6)- "name"
- "title"
- "university"
- "needs"
- "eventTitle"
- "hashtag"
slant任意"forward"wanted必須objectbackground必須object | object | object|1必須objectkind必須"builtin"key必須enum(5)- "tokyo-portrait"
- "tokyo-assemble-pass-v7"
- "tokyo-assemble-pass-v7-tight"
- "tokyo-assemble-pass-v7-beams"
- "wanted-paper"
|2必須objectkind必須"image"imageId必須string(uuid)|3必須objectkind必須"solid"color必須string/^#[0-9a-fA-F]{6}$/layers必須array<object | object | object | object>件数 1–32|1必須objectid必須string/^[a-zA-Z0-9_-]{1,40}$/x必須number0–1y必須number0–1width必須number0.0007072135785007072–1height必須number0.0005–1kind必須"avatar"shape必須"rect" | "circle"radius必須number0–0.5tilt任意"forward"|2必須objectid必須string/^[a-zA-Z0-9_-]{1,40}$/x必須number0–1y必須number0–1width必須number0.0007072135785007072–1height必須number0.0005–1kind必須"rect"color必須string/^#[0-9a-fA-F]{6}$/opacity必須number0–1radius必須number0–0.5gradient任意string/^#[0-9a-fA-F]{6}$/tilt任意"forward"requires任意enum(6)- "name"
- "title"
- "university"
- "needs"
- "eventTitle"
- "hashtag"
|3必須objectid必須string/^[a-zA-Z0-9_-]{1,40}$/x必須number0–1y必須number0–1width必須number0.0007072135785007072–1height必須number0.0005–1kind必須"logo"key必須"spikes-symbol" | "spikes-wordmark" | "spikes-vertical"opacity必須number0–1|4必須objectid必須string/^[a-zA-Z0-9_-]{1,40}$/x必須number0–1y必須number0–1width必須number0.0007072135785007072–1height必須number0.0005–1kind必須"text"binding必須enum(6) | null- "name"
- "title"
- "university"
- "needs"
- "eventTitle"
- "hashtag"
text必須string長さ ≤200color必須string/^#[0-9a-fA-F]{6}$/font必須"sans" | "display" | "wanted"fontSize必須integer16–300weight必須400 | 700align必須"left" | "center" | "right"maxLines必須integer1–8shadow任意objectcolor必須string/^#[0-9a-fA-F]{6}$/x必須integer-16–16y必須integer-16–16blur必須integer0–32tilt任意"forward"requires任意enum(6)- "name"
- "title"
- "university"
- "needs"
- "eventTitle"
- "hashtag"
slant任意"forward"
返るもの(応答)200 · application/json
成功したときに返る形。入れ子の欄は、その行を押すと開く・閉じる。「任意」の印がある欄は返らないことがある。
mimeType"image/png"datastring長さ ≤5592408bytesinteger≤4194304issuesarray<string>件数 ≤32
失敗したとき(エラー)
失敗したときの状態コードと、その意味。本文の error の値で、プログラムが失敗の種類を見分けられる。
- 400入力の誤り(error = invalid_input など)
- 401未ログイン(unauthorized)/ Bearer が無効(invalid_token。WWW-Authenticate 付き)
- 403権限が無い
- 429レート制限(Retry-After 付き)
- unauthorized
- invalid_token
- invalid_origin
- invalid_input
- payload_too_large
- forbidden
- consent_required
- actor_changed
- event_not_found
- visual_revision_conflict
- background_not_owned_by_event
- background_unavailable
- rate_limited
呼び出しの見本
そのまま試せる呼び出しの例。curl と fetch をタブで切り替える。ID やトークンは自分の値に置き換える。
curl -X POST "https://bounty.spikes.4s.link/api/participation-visual/events/{eventId}/preview" \
-H "Authorization: Bearer $BEARER_AUTH" \
-H "Content-Type: application/json" \
-d '{
"expectedRevision": 0,
"purpose": "participation"
}'