POST/api/participation-visual/events/{eventId}/validate
「コンテンツ企画」の分類の、新しく作る、または操作を実行するために内容を送る API。ログインした本人として呼ぶ。
- 要約
合成見本で両用途のレイアウト・画像・フォントを検査
- 呼び方と印
ログイン・レート制限
短い時間に呼びすぎると断られる API(レート制限)。断られたら Retry-After の秒数を待って呼び直す。
URL に付ける値(パラメータ)
経路の中の波かっこの部分と、URL の ? の後ろに付ける値。「必須」の印があるものは省けない。
eventIdpath必須string(uuid)
送るもの(本文)application/json
送る本文の欄。「必須」の印がある欄は省けない。
expectedActorId必須string(uuid)expectedRevision必須integer≥0draft必須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
成功したときに返る形。入れ子の欄は、その行を押すと開く・閉じる。「任意」の印がある欄は返らないことがある。
validtrueissuesarray<string>
失敗したとき(エラー)
失敗したときの状態コードと、その意味。本文の 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}/validate" \
-H "Authorization: Bearer $BEARER_AUTH" \
-H "Content-Type: application/json" \
-d '{
"expectedActorId": "00000000-0000-4000-8000-000000000000",
"expectedRevision": 0,
"draft": {
"version": 1,
"width": 1414,
"height": 2000,
"purposes": {
"participation": {
"background": {
"kind": "builtin",
"key": "tokyo-portrait"
},
"layers": [
{
"id": "string",
"x": 0,
"y": 0,
"width": 0.0007072135785007072,
"height": 0.0005,
"kind": "avatar",
"shape": "rect",
"radius": 0
}
]
},
"wanted": {
"background": {
"kind": "builtin",
"key": "tokyo-portrait"
},
"layers": [
{
"id": "string",
"x": 0,
"y": 0,
"width": 0.0007072135785007072,
"height": 0.0005,
"kind": "avatar",
"shape": "rect",
"radius": 0
}
]
}
}
}
}'