ファイル、フォント、通貨
公開プレビューファイルはブラウザーで利用できます。保護されたファイルには、署名付き 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
}
]