本文へ移動
Bounty Developer

POST/api/planning/blocks/{contentId}/thumbnail/duplicate

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

要約

テンプレート(おまかせを含む)か取ってある配置を「自分で組む」配置へ写して返す(保存しない。白紙ではなく動く配置から始める)

呼び方と印

ログイン・レート制限

短い時間に呼びすぎると断られる API(レート制限)。断られたら Retry-After の秒数を待って呼び直す。

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

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

  • contentIdpath必須string(uuid)

送るもの(本文)application/json

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

  • from必須enum(8) | string
  • theme任意"tokyo" | "light" | "dark" | "paper"

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

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

  • contentIdstring(uuid)
  • fromstring
  • layoutobject
    • version1
    • elementsarray<object>件数 1–80
      • idstring/^[a-z][a-z0-9_]{0,31}$/
      • kindenum(14)"title" "label" "datetime" "stage" "event" "logo" "speaker_photo" "speaker_name" "speaker_title" "speaker_company" "open_seat" "rule" …+2
      • index任意integer0–23
      • boxobject
        • portraitobject | null
          • xnumber0–1
          • ynumber0–1
          • wnumber≤1
          • hnumber≤1
        • squareobject | null
          • xnumber0–1
          • ynumber0–1
          • wnumber≤1
          • hnumber≤1
        • landscapeobject | null
          • xnumber0–1
          • ynumber0–1
          • wnumber≤1
          • hnumber≤1
      • align任意"left" | "center" | "right"
      • valign任意"top" | "middle" | "bottom"
      • style任意enum(5)"display" "title" "name" "body" "caption"
      • color任意enum(9)"on_background" "muted" "accent" "on_accent" "background" "surface" "rule" "strip" "on_strip"
      • fill任意enum(9)"on_background" "muted" "accent" "on_accent" "background" "surface" "rule" "strip" "on_strip"
      • opacity任意number0–1
      • size任意number0.3–4
      • maxLines任意integer1–8
      • fit任意"shrink" | "fixed"
  • layoutsarray<object>
    • formatenum(6)"story" "portrait" "square" "landscape" "classic" "ogp"
    • family"portrait" | "square" | "landscape"
    • widthinteger
    • heightinteger
    • templateenum(8)"title" "solo" "duo" "panel" "featured" "many" "open_call" "custom"
    • titleLinesarray<string>
    • titleSizenumber
    • elementsarray<object>
      • idstring
      • kind"text" | "image" | "shape"
      • rolestring
      • xnumber
      • ynumber
      • wnumber
      • hnumber
      • lines任意array<string>
      • size任意number
      • speakerId任意string(uuid)
    • issuesarray<object>
      • codeenum(6)"overflow" "outside" "below_floor" "overlap" "truncated" "empty"
      • targetstring
      • detailstring
    • warningsarray<object>
      • codestring
      • messagestring
      • target任意string

失敗したとき(エラー)

失敗したときの状態コードと、その意味。本文の 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 を参照)
  • 415HTTP 415(x-bounty-error-codes を参照)
  • 428HTTP 428(x-bounty-error-codes を参照)
  • 429レート制限(Retry-After 付き)
  • 501HTTP 501(x-bounty-error-codes を参照)
  • unauthorized
  • forbidden
  • invalid_input
  • invalid_origin
  • consent_required
  • content_not_found
  • published_content_locked
  • thumbnail_template_not_found

呼び出しの見本

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

curl -X POST "https://bounty.spikes.4s.link/api/planning/blocks/{contentId}/thumbnail/duplicate" \
  -H "Authorization: Bearer $BEARER_AUTH" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "auto"
  }'
POST /api/planning/blocks/{contentId}/thumbnail/duplicate | Bounty Developer