本文へ移動
Bounty Developer

POST/api/companies

「企業ページ」の分類の、新しく作る、または操作を実行するために内容を送る API。ブラウザでログインした本人(cookie)として呼ぶ。

要約

会社を非公開で登録し、最初の管理者を迎える限定リンクを作る(ブラウザのログインだけ)

呼び方と印

ログイン(cookie)

送るもの(本文)application/json

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

  • name必須string
    長さ 1–120
  • slug必須string
    /^[a-z0-9-]{1,100}$/
  • description必須string | null
    長さ ≤200
  • logoUrl必須string | null
    長さ ≤2048
  • logoImageId任意string(uuid) | null
  • darkLogoUrl任意string | null
    長さ ≤2048
  • darkLogoImageId任意string(uuid) | null
  • isPublic任意boolean
  • website必須string | null
    長さ ≤2048
  • foursOrgId必須string | null
    長さ ≤100
  • expectedRevision任意integer
    ≥0
  • eventId任意string(uuid)

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

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

  • idstring
  • namestring
  • slugstring
  • descriptionstring | null
  • logoUrlstring | null
  • logoImageIdstring | null
  • websitestring | null
  • foursOrgIdstring | null
  • isPublicboolean
  • darkLogoUrlstring | null
  • darkLogoImageIdstring | null
  • revisioninteger
  • createdAtstring
  • updatedAtstring
  • joinLink任意object
    • urlstring
    • expiresAtstring
  • adminInviteobject
    • idstring(uuid)
    • companyIdstring(uuid)
    • role"admin" | "reception" | "member"
    • labelstring | null
    • expiresAtstring(date-time)
    • maxUsesinteger
    • urlstring
    • delivery"manual_only"

失敗したとき(エラー)

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

  • 400入力の誤り(error = invalid_input など)
  • 401未ログイン(unauthorized)/ Bearer が無効(invalid_token。WWW-Authenticate 付き)
  • 403権限が無い
  • 409HTTP 409(x-bounty-error-codes を参照)
  • 413HTTP 413(x-bounty-error-codes を参照)
  • 415HTTP 415(x-bounty-error-codes を参照)
  • 428HTTP 428(x-bounty-error-codes を参照)
  • 503HTTP 503(x-bounty-error-codes を参照)
  • invalid_origin
  • unsupported_media_type
  • forbidden
  • company_not_found
  • event_manager_required
  • identity_locked
  • company_exists
  • image_not_found
  • admin_invite_requires_session
  • invalid_input
  • consent_required
  • public_origin_invalid

呼び出しの見本

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

curl -X POST "https://bounty.spikes.4s.link/api/companies" \
  -b "bounty_session=$COOKIE_AUTH" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "slug": "string",
    "description": "string",
    "logoUrl": "string",
    "website": "string",
    "foursOrgId": "string"
  }'
POST /api/companies | Bounty Developer