API - 概要

API - ファイル、フォント、通貨

公開ファイルや保護されたファイルをダウンロードし、フォントの一覧と利用可能な通貨を取得します。

エンドポイント一覧

メソッドエンドポイント説明アクセス
GET/public-api/v1/file/public/products/:productId/:size商品の公開プレビューを返します。サイズには small.png、medium.png、big.png のいずれかを指定してください。公開
GET/public-api/v1/file/protected/:keyストレージキーを指定して保護されたファイルを取得します。署名付き URL または files:read
GET/public-api/v1/fonts利用可能なすべてのフォントを返します。公開
GET/public-api/v1/currenciesすべての通貨を返します。公開

ファイル、フォント、通貨

公開プレビューファイルはブラウザーで利用できます。保護されたファイルには、署名付き URL または files:read スコープを持つ API 認証情報が必要です。フォントと通貨は公開の読み取りエンドポイントです。

エンドポイントアクセス詳細
/file/public/products/:productId/small.png公開小サイズの商品プレビュー。
/file/public/products/:productId/medium.png公開中サイズの商品プレビュー。
/file/public/products/:productId/big.png公開大サイズの商品プレビュー。
/file/protected/:key署名付き URL または files:read保護されたオブジェクトストレージのファイル。
/fonts公開フォントレコードの配列。
/currencies公開通貨レコードの配列。

リクエスト例(fetch)

const publicPreview = await fetch(
  'https://alterproduct.com/public-api/v1/file/public/products/4/medium.png'
);

const protectedFile = await fetch(
  'https://alterproduct.com/public-api/v1/file/protected/user_34/381/design/mockup-large.webp',
  {
    headers: authHeaders
  }
);

const fonts = await fetch('https://alterproduct.com/public-api/v1/fonts').then((res) => res.json());
const currencies = await fetch('https://alterproduct.com/public-api/v1/currencies').then((res) => res.json());

レスポンス例

[
  {
    "id": 1,
    "family": "Inter",
    "source": "google",
    "category": "sans-serif",
    "variants": ["regular", "600", "700"],
    "subsets": ["latin"],
    "version": "v19",
    "menu": "Inter",
    "files": {
      "regular": "https://..."
    }
  }
]
[
  {
    "id": 1,
    "code": "EUR",
    "name": "Euro",
    "symbol": "€",
    "decimalPlaces": 2
  }
]