本文へ移動
Bounty Developer

POST/api/passes/{eventId}/preview

「QR」の分類の、新しく作る、または操作を実行するために内容を送る API。ログインした本人として呼ぶ。

要約

本人パスの印字PNGとレイヤーを描画(書込みなし)

呼び方と印

ログイン

URL に付ける値(パラメータ)

経路の中の波かっこの部分と、URL の ? の後ろに付ける値。「必須」の印があるものは省けない。

  • eventIdpath必須string(uuid)

送るもの(本文)application/json

送る本文の欄。「必須」の印がある欄は省けない。

  • templateRevision必須integer
    0–2147483646
  • content必須object
  • name必須string
    長さ ≤160
  • title必須string
    長さ ≤160
  • affiliation必須string
    長さ ≤160
  • logos任意array<object>
    件数 ≤4
  • kind必須"company" | "guild" | "venture"
  • orgId必須string(uuid)
  • imageId必須string(uuid)
  • assetHash必須string
    /^[0-9a-f]{64}$/
  • x任意number
    0–1
  • y任意number
    0–1
  • widthPx任意integer
    24–300
  • layers任意object
  • name任意object
  • fontPx任意integer
    22–256
  • x任意number
    0–1
  • y任意number
    0–1
  • title任意object
  • fontPx任意integer
    22–256
  • x任意number
    0–1
  • y任意number
    0–1
  • affiliation任意object
  • fontPx任意integer
    22–256
  • x任意number
    0–1
  • y任意number
    0–1
  • qr任意object
  • x任意number
    0–1
  • y任意number
    0–1
  • fontScale必須"small" | "normal" | "large"
  • lineMode必須"auto" | "manual"

返るもの(応答)200 · application/json

成功したときに返る形。入れ子の欄は、その行を押すと開く・閉じる。「任意」の印がある欄は返らないことがある。

  • renderobject
    • imagestring長さ ≤1500000 · /^data:image\/png;base64,/
    • hashstring/^[0-9a-f]{64}$/
    • layers任意array<object>件数 ≤8
      • idenum(8)"name" "title" "affiliation" "qr" "logo:0" "logo:1" "logo:2" "logo:3"
      • imagestring長さ ≤1500000 · /^data:image\/png;base64,/
      • xinteger≥0
      • yinteger≥0
      • widthinteger
      • heightinteger
      • fontPx任意integer22–256
    • widthPxinteger
    • heightPxinteger
    • widthMmnumber≤62
    • lengthMmnumber≤62
    • linesobject
      • namearray<string>件数 ≤2
      • titlearray<string>件数 ≤2
      • affiliationarray<string>件数 ≤2

失敗したとき(エラー)

失敗したときの状態コードと、その意味。本文の error の値で、プログラムが失敗の種類を見分けられる。

  • 400入力の誤り(error = invalid_input など)
  • 401未ログイン(unauthorized)/ Bearer が無効(invalid_token。WWW-Authenticate 付き)
  • 403権限が無い
  • 404HTTP 404(x-bounty-error-codes を参照)
  • 409HTTP 409(x-bounty-error-codes を参照)
  • 422HTTP 422(x-bounty-error-codes を参照)
  • 428HTTP 428(x-bounty-error-codes を参照)
  • pass_ticket_required
  • pass_template_disabled
  • consent_required
  • pass_human_action_required

呼び出しの見本

そのまま試せる呼び出しの例。curl と fetch をタブで切り替える。ID やトークンは自分の値に置き換える。

curl -X POST "https://bounty.spikes.4s.link/api/passes/{eventId}/preview" \
  -H "Authorization: Bearer $BEARER_AUTH" \
  -H "Content-Type: application/json" \
  -d '{
    "templateRevision": 0,
    "content": {
      "name": "string",
      "title": "string",
      "affiliation": "string",
      "fontScale": "small",
      "lineMode": "auto"
    }
  }'
POST /api/passes/{eventId}/preview | Bounty Developer