SUZURI API は、新しい商品の作成や、商品データの読み込みなど、SUZURIの基本的な機能へのアクセスを提供します。APIを使うことで、SUZURIの機能を利用した色々なアプリケーションやサービスを作ることができるようになります。
SUZURI API v1の概要について説明します。なお、ドキュメントの構成について、Qiita API v2のドキュメントを参考にさせていただきました。この場を借りて御礼申し上げます。
APIとの通信にはHTTPSプロトコルを利用します。エンドポイントは suzuri.jp/api/v1
です。
GET、POST、PUT、DELETEの4種類のHTTPメソッドを利用します。パラメータは、GETリクエストではURIクエリ、それ以外の場合にはapplication/json
形式のリクエストボディに含めることができます。各APIには任意で利用できるパラメータと、必ず含めなければならないパラメータがあります。どのようなパラメータがあるのかについては、このドキュメントの各API項目に記載しています。
通常の処理が完了すると、APIはレスポンスボディとともにステータスコード200
(一部204
) を返します。また、正常な処理が行われなかった場合、APIは40x
系または50x
系のステータスコードを返します。このとき、レスポンスボディの中身は保証されないため、APIにリクエストした後は、はじめにステータスコードを確認するようにしてください。
一部APIにはレートリミットを設けてあります。レートリミットに関する情報はレスポンスヘッダに含められ、X-Ratelimit-Limit
は最大回数、X-Ratelimit-Remaining
は残り利用可能回数、X-Ratelimit-Reset
は制限リセット時刻(UTC)を示します。
すべてのリクエストにはアクセストークンの送信が必要です。アクセストークンは、後述するOAuthを利用した認可フローで発行するか、ユーザごとに付与されるAPIキーを利用することができます。
ユーザ1人につき1つずつ、APIキーが付与されます。これは、開発や個人利用にお使いいただける、read
とwrite
スコープを持つ、ユーザのアクセストークンです。アプリケーションの管理画面で確認ができます。
アクセストークンは、以下のようにAuthorizationリクエストヘッダに含められます。
Authorization: Bearer 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd
本ドキュメントには、各リクエストポイントにcurlサンプルが記載されていますが、上記ヘッダオプションについては省略されているものとします。実際にcurlコマンドでAPIを利用する際は、下記オプションを追加する必要があります。
-H "Authorization: Bearer 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd"
アクセストークンはそれぞれ、スコープを持ちます。read
とwrite
という二種類のスコープがあります。開発者は、アプリケーションを登録する際に要求するスコープを指定する必要があり、アプリケーションを利用するユーザはどのスコープが要求されているかを認可画面で確認できます。すべての操作にはread
スコープが必須であり、情報の書き込みや削除、更新に関わるAPIではさらにwrite
スコープが必要になります。適切なスコープを持たないアクセストークンでのリクエストには401 Unauthorized
が返ります。
GET https://suzuri.jp/oauth/authorize
認可リクエストです。アクセストークンを発行するには、アプリケーションのユーザに認可画面を表示する必要があります。ユーザがアプリケーションからのアクセスを認可すると、アプリケーション登録時に指定されたURLにリダイレクトされ、その際にcode
が付与されます。アプリケーションでは、このcode
の値を利用して POST https://suzuri.jp/oauth/token
にリクエストを送り、アクセストークンを発行します。
Name | Type | Description | Example |
---|---|---|---|
client_id | string | 登録されたAPIクライアントを特定するためのIDです。 | "b9f0b0a3ae23e9e93c5989829498d173e735024abe807c8e507036187e8c20fb" |
scope | string | アプリケーションが利用するスコープをスペース区切りで指定してください。 | "read write" |
redirect_uri | string | 認可コード付きでリダイレクトするuriを指定してください。 | "http://yourapplication.com/callback" |
response_type | string | 値は"code" でなければなりません。 |
"code" |
POST https://suzuri.jp/oauth/token
トークンリクエストです。以下のパラメータを application/x-www-form-urlencoded
フォーマットでリクエストすることで、アクセストークンを取得します。
Name | Type | Description | Example |
---|---|---|---|
grant_type | string | 値は"authorization_code" でなければなりません。 |
"authorization_code" |
code | string | リダイレクトURIに付与された認可コードです。 | "07bedccac71b7ec68dfb6b5e77b07752414a7f76ed83055e98ceed8f4508e05c" |
redirect_uri | string | 認可リクエストに含まれていたものと同一の redirect_uri を指定してください。 |
"http://yourapplication.com/callback" |
client_id | string | 認可リクエストに含まれていたものと同一の client_id を指定してください。 |
"b9f0b0a3ae23e9e93c5989829498d173e735024abe807c8e507036187e8c20fb" |
client_secret | string | アプリケーション管理ページで確認できる client_secret を指定してください。 |
"bc75e3bcb3dac20eb8e18931ba4de36c0dbbd301c83813fb84891742659fabe9" |
SUZURI APIは、APIを定義するJSON Schemaを公開しています。
下記コマンド、あるいはこのリンクより取得することができます。
$ curl -n -X GET https://suzuri.jp/api/v1/schema
本APIに関するお問い合わせや、ご意見・ご要望等ございましたら、 どうかお気軽に@suzurijpまでご連絡ください!お待ちしております!
ログインユーザに対しての、SUZURI内のできごとです。(売れた/ズッキュンがついたなど)
Details
Activityのリストを取得します。
GET /api/v1/activities
Name | Type | Description | Example |
---|---|---|---|
limit | string | 取得するActivityの数を指定します(デフォルトは30、最大30) pattern: [1-9]|[1-2][0-9]|30$ | 30 |
$ curl -n /api/v1/activities
-G \
-d limit=30
HTTP/1.1 200 OK
{
"activities": [
{
"id": "335104feaace0fe03d3348994486eaec",
"message": "鹿さん が【去年の暮れあたりから蝶がついてきてるモグラ Tシャツ】にズッキュンしたよ。",
"timeago": "2時間前",
"eventType": "favorite",
"eventAction": "provide",
"createdAt": "2015-01-14 11:58:29 +0900",
"sender": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488",
"profile": {
"url": "https://suzuri.jp/",
"body": "こんにちは!SUZURI の公式忍者・スリスリくんです。\\nキミも忍者にならないか?",
"headerUrl": "https://dp3obxrw75ln8.cloudfront.net/profiles/headers/10.png?1398245916"
},
"identities": [
{
"id": 1,
"provider": "twitter",
"uid": 1181557592,
"nickname": "surisurikun",
"url": "https://twitter.com/surisurikun"
}
],
"official": true
},
"receiver": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488",
"profile": {
"url": "https://suzuri.jp/",
"body": "こんにちは!SUZURI の公式忍者・スリスリくんです。\\nキミも忍者にならないか?",
"headerUrl": "https://dp3obxrw75ln8.cloudfront.net/profiles/headers/10.png?1398245916"
},
"identities": [
{
"id": 1,
"provider": "twitter",
"uid": 1181557592,
"nickname": "surisurikun",
"url": "https://twitter.com/surisurikun"
}
],
"official": true
},
"event": null
}
]
}
Details
未読のActivityの数を取得します。
GET /api/v1/activities/unreads
$ curl -n /api/v1/activities/unreads
HTTP/1.1 200 OK
{
"unreads": 3
}
LPやセール情報のバナー
Details
Name | Type | Description | Example |
---|---|---|---|
displaySize | string | Bannerのディスプレイサイズ | "1440w" |
id | integer | Bannerの一意なID | 1 |
imageUrl | string | Bannerの画像URL | "https://dijsur42hqnz1.cloudfront.net/assets/banner/top/2020/five-panel-cap/360-801a0bc6242bd566de9b17c1a36690f83fdbc0eb51e7aa3827334b3f363d1eba.png" |
Category(カテゴリ)は、SUZURIでつくることができるアイテムの分類です。ファッションや日用品などのCategory(カテゴリ)があります。
Details
Name | Type | Description | Example |
---|---|---|---|
imageUrls | string | Categoryの画像のURL | {"png":"/assets/images/categories/t-shirts.png"} |
items | array | [{"id":1,"name":"t-shirt","angles":[1],"humanizeName":"スタンダードTシャツ","availablePrintPlaces":["front","back"],"defaultPrintPlace":"front","displayOrder":9,"essentialAngles":["front","back"],"extraAngles":["front-wearing-mens","front-wearing-ladies"],"iconUrls":{"png":"/assets/items/t-shirt.png"},"wearingImageUrls":{"png":"/assets/wearing_by_item/t-shirt.png"},"isMultiPrintable":true,"printPlaceDisplayNames":{"front":"前面","back":"背面"},"printPlaceForExtraAngles":{"t-shirt":{"front-wearing-mens":"front","front-wearing-ladies":"front"}},"imageDescriptions":["","","男性モデル: 179cm","女性モデル: 163cm"],"productImageUrlTemplates":{"front":"https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}\u0026printed={printed}"}}] |
|
name | string | Categoryの一意な名前 | "Apparel" |
Choiceは、UserがProductを集めて作れるリストです。サイト内ではChoiceのことはオモイデと呼ばれています。
Details
Name | Type | Description | Example |
---|---|---|---|
bannerUrl | nullable uri | Choiceページのバナー画像URL | "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246" |
description | nullable string | Choiceの説明文 | "猫の商品を沢山あつめてみました。" |
id | integer | Choiceのid | 7 |
productsCount | integer | Choiceに入っているProductの数 | 1 |
secret | boolean | Choiceの非公開フラグ(通常はfalse) | false |
title | string | Choiceのタイトル | "スリスリピックアップ" |
user:avatarUrl | nullable string | Userのアバター画像のURL | "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488" |
user:displayName | nullable string | ウェブページなどに表示するUserの名前 | "忍者スリスリくん" |
user:id | integer | Userの一意なID | 1 |
user:name | string | Userの一意な名前 | "surisurikun" |
Details
idで指定したChoiceの情報を取得します。
GET /api/v1/choices/{choice_id}
$ curl -n /api/v1/choices/$CHOICE_ID
HTTP/1.1 200 OK
{
"choice": {
"id": 7,
"title": "スリスリピックアップ",
"description": "猫の商品を沢山あつめてみました。",
"secret": false,
"bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
"productsCount": 1,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
}
}
Details
Choiceを作成します。
POST /api/v1/choices
Name | Type | Description | Example |
---|---|---|---|
title | string | 作成するChoiceのタイトル | "スリスリピックアップ" |
Name | Type | Description | Example |
---|---|---|---|
bannerUrl | string | 作成するChoiceのバナー画像URL | "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246" |
choiceProducts/itemVariantId | integer | アイテムバリエーションの一意なID | 1 |
choiceProducts/productId | integer | Productの一意なID | 1 |
description | string | 作成するChoiceの説明 | "猫の商品を沢山あつめてみました。" |
$ curl -n -X POST /api/v1/choices \
-d '{
"title": "スリスリピックアップ",
"description": "猫の商品を沢山あつめてみました。",
"bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
"choiceProducts": [
{
"productId": 1,
"itemVariantId": 1
}
]
}' \
-H "Content-Type: application/json"
HTTP/1.1 200 OK
{
"choice": {
"id": 7,
"title": "スリスリピックアップ",
"description": "猫の商品を沢山あつめてみました。",
"secret": false,
"bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
"productsCount": 1,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
}
}
Details
Choiceを削除します。成功すると204を返します。
DELETE /api/v1/choices/{choice_id}
$ curl -n -X DELETE /api/v1/choices/$CHOICE_ID \
-H "Content-Type: application/json"
HTTP/1.1 204 No Content
レスポンスヘッダのみ返します
Details
Choiceに指定したProductを追加します。
POST /api/v1/choices/{choice_id}
Name | Type | Description | Example |
---|---|---|---|
itemVariantId | integer | Choiceに追加したいProductのItem Variant (色とサイズの組み合わせ) id Range: 1 <= value |
1 |
productId | integer | Choiceに追加したいProductのid Range: 1 <= value |
1 |
$ curl -n -X POST /api/v1/choices/$CHOICE_ID \
-d '{
"productId": 1,
"itemVariantId": 1
}' \
-H "Content-Type: application/json"
HTTP/1.1 200 OK
{
"choice": {
"id": 7,
"title": "スリスリピックアップ",
"description": "猫の商品を沢山あつめてみました。",
"secret": false,
"bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
"productsCount": 1,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
}
}
Details
Choiceから指定したProductを削除します。
POST /api/v1/choices/{choice_id}/remove
Name | Type | Description | Example |
---|---|---|---|
itemVariantId | integer | Choiceから削除したいProductのItem Variant (色とサイズの組み合わせ) id Range: 1 <= value |
1 |
productId | integer | Choiceから削除したいProductのid Range: 1 <= value |
1 |
$ curl -n -X POST /api/v1/choices/$CHOICE_ID/remove \
-d '{
"productId": 1,
"itemVariantId": 1
}' \
-H "Content-Type: application/json"
HTTP/1.1 200 OK
{
"choice": {
"id": 7,
"title": "スリスリピックアップ",
"description": "猫の商品を沢山あつめてみました。",
"secret": false,
"bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
"productsCount": 1,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
}
}
Details
Choiceのタイトルや説明を更新します。
PUT /api/v1/choices/{choice_id}/
Name | Type | Description | Example |
---|---|---|---|
bannerUrl | nullable uri | Choiceページのバナー画像URL | "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246" |
choiceProducts/itemVariantId | integer | アイテムバリエーションの一意なID | 1 |
choiceProducts/productId | integer | Productの一意なID | 1 |
description | nullable string | Choiceの説明文 | "猫の商品を沢山あつめてみました。" |
title | string | Choiceのタイトル | "スリスリピックアップ" |
$ curl -n -X PUT /api/v1/choices/$CHOICE_ID/ \
-d '{
"title": "スリスリピックアップ",
"description": "猫の商品を沢山あつめてみました。",
"bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
"choiceProducts": [
{
"productId": 1,
"itemVariantId": 1
}
]
}' \
-H "Content-Type: application/json"
HTTP/1.1 200 OK
{
"choice": {
"id": 7,
"title": "スリスリピックアップ",
"description": "猫の商品を沢山あつめてみました。",
"secret": false,
"bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
"productsCount": 1,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
}
}
Details
Choiceの一覧を取得します。
GET /api/v1/choices
Name | Type | Description | Example |
---|---|---|---|
limit | string | 取得するChoiceの数の上限(デフォルトは20、最大50) pattern: [1-9]|[1-4][0-9]|50$ | 15 |
offset | string | 取得するChoiceの開始位置 (デフォルトは0, 数字が大きいほど古い) pattern: [0-9][0-9]*$ | 100 |
userId | string | 取得するChoiceをUser id で絞り込む pattern: [1-9][0-9]*$ | 2 |
userName | string | 取得するChoiceをUser name で絞り込む pattern: [\w-]*$ | "surisurikun" |
$ curl -n /api/v1/choices
-G \
-d limit=15 \
-d offset=100 \
-d userId=2 \
-d userName=surisurikun
HTTP/1.1 200 OK
{
"choices": [
{
"id": 7,
"title": "スリスリピックアップ",
"description": "猫の商品を沢山あつめてみました。",
"secret": false,
"bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
"productsCount": 1,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
}
],
"meta": {
"hasNext": true
}
}
Favorite(ズッキュン)は、UserがProductを気に入った時にするアクションです(Facebookのいいね!やtwitterのお気に入りのようなものです)
Details
Name | Type | Description | Example |
---|---|---|---|
count | integer | Favoriteの数 | 3 |
id | integer | Favoriteのid | 7 |
productId | integer | Favoriteの対象となる商品のid | 14 |
Details
指定したProductへのFavorite情報を取得します。(ズッキュンを行なったUser情報がレスポンスに含まれます)
GET /api/v1/products/{product_id}/favorites
Name | Type | Description | Example |
---|---|---|---|
itemId | string | 取得するFavoriteをItemのIDで絞り込む pattern: [1-9][0-9]*$ | 1 |
limit | string | 取得するFavoriteの数を指定します(デフォルトは20、最大50) pattern: [1-9]|[1-4][0-9]|50$ | 30 |
offset | string | 取得するFavoriteの開始位置を指定します。 pattern: [0-9][0-9]*$ | 100 |
$ curl -n /api/v1/products/$PRODUCT_ID/favorites
-G \
-d itemId=1 \
-d limit=30 \
-d offset=100
HTTP/1.1 200 OK
{
"favorites": [
{
"id": 7,
"count": 3,
"productId": 14,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
}
],
"meta": {
"hasNext": true
}
}
Details
指定したUserによるFavorite情報を取得します。(対象のProduct情報がレスポンスに含まれます)
GET /api/v1/users/{user_id}/favorites
$ curl -n /api/v1/users/$USER_ID/favorites
HTTP/1.1 200 OK
{
"favorites": [
{
"id": 7,
"count": 3,
"product": {
"id": 1,
"title": "AAスリスリくん スタンダードTシャツ",
"published": true,
"publishedAt": "2015-01-14 11:58:29 +0900",
"createdAt": "2015-01-14 11:58:29 +0900",
"updatedAt": "2015-01-14 11:58:29 +0900",
"examplaryAngle": "back",
"imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
"sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
"priceWithTax": 2080,
"discountedPriceWithTax": 2288,
"item": {
"id": 1,
"name": "t-shirt",
"angles": [
1
],
"humanizeName": "スタンダードTシャツ",
"availablePrintPlaces": [
"front",
"back"
],
"defaultPrintPlace": "front",
"displayOrder": 9,
"essentialAngles": [
"front",
"back"
],
"extraAngles": [
"front-wearing-mens",
"front-wearing-ladies"
],
"iconUrls": {
"png": "/assets/items/t-shirt.png"
},
"wearingImageUrls": {
"png": "/assets/wearing_by_item/t-shirt.png"
},
"isMultiPrintable": true,
"printPlaceDisplayNames": {
"front": "前面",
"back": "背面"
},
"printPlaceForExtraAngles": {
"t-shirt": {
"front-wearing-mens": "front",
"front-wearing-ladies": "front"
}
},
"imageDescriptions": [
"",
"",
"男性モデル: 179cm",
"女性モデル: 163cm"
],
"productImageUrlTemplates": {
"front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
}
},
"material": {
"id": 31106,
"title": "AAスリスリくん",
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"price": 100,
"priceWithTax": 110,
"violation": false,
"published": true,
"publishedAt": "2014-05-07 11:05:25 +0900",
"uploadedAt": "2014-05-07 11:03:15 +0900",
"dominantRgb": "#ffffff",
"originalWidth": 1920,
"originalHeight": 1080,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
},
"sampleItemVariant": {
"id": 1,
"price": 2080,
"exemplary": true,
"enabled": true,
"isLightColor": true,
"isDarkColor": true,
"color": {
"id": 1,
"name": "white",
"displayName": "ホワイト",
"rgb": "#ffffff"
},
"size": {
"id": 1,
"name": "s",
"displayName": "S"
},
"printPlaces": [
{
"id": 1,
"place": "front",
"price": 500,
"itemVariantId": 2
}
],
"priceWithTax": 2288
}
}
}
],
"meta": {
"hasNext": true
}
}
Details
ProductをFavoriteします。レートリミットが設けてあります。
POST /api/v1/products/{product_id}/favorites
Name | Type | Description | Example |
---|---|---|---|
anonymouse | boolean | 匿名のFavoriteとする場合true | true |
count | integer | Favoriteの更新数(最大: 100) | 10 |
$ curl -n -X POST /api/v1/products/$PRODUCT_ID/favorites \
-d '{
"anonymouse": true,
"count": 10
}' \
-H "Content-Type: application/json"
HTTP/1.1 201 Created
{
"favorite": {
"id": 7,
"count": 3,
"rotation": 138,
"x": 0.5702,
"y": 0.5702
},
"meta": {
"totalCount": 10
}
}
Details
ズッキュンを削除します。
DELETE /api/v1/products/{product_id}/favorites
$ curl -n -X DELETE /api/v1/products/$PRODUCT_ID/favorites \
-H "Content-Type: application/json"
HTTP/1.1 200 OK
{
"id": 7,
"count": 3,
"productId": 14
}
SUZURIユーザが認証に利用した外部サービス
Details
Name | Type | Description | Example |
---|---|---|---|
id | integer | Identityの一意なID | 1 |
nickname | nullable string | 連携サービス上でのユーザの一意な名前 | "surisurikun" |
provider | string | 連携サービスの名前 | "twitter" |
uid | nullable string | 連携サービス上でのユーザの一意なID | 1181557592 |
url | nullable string | 連携サービス上のユーザのURL | "https://twitter.com/surisurikun" |
Item(アイテム)は、SUZURIでつくることができる商品の種類です。TシャツやマグカップなどのItem(アイテム)があります。
Details
Name | Type | Description | Example |
---|---|---|---|
angles | array | Itemの画像におけるアングルの種類 | [1] |
availablePrintPlaces | array | プリント可能な箇所 | ["front","back"] |
defaultPrintPlace | string | デフォルトのプリント箇所 | "front" |
displayOrder | integer | アイテム一覧に表示する際の並び順 | 9 |
essentialAngles | array | 一覧に表示するアングルとして選べる角度 | ["front","back"] |
extraAngles | array | 一覧に表示するアングルとして選択できない角度 | ["front-wearing-mens","front-wearing-ladies"] |
humanizeName | string | Itemを表す名前 | "スタンダードTシャツ" |
iconUrls | object | アイテムアイコンのURL | {"png":"/assets/items/t-shirt.png"} |
id | integer | Itemのid | 1 |
imageDescriptions | array | 商品ページの各画像の説明 | ["","","男性モデル: 179cm","女性モデル: 163cm"] |
isMultiPrintable | boolean | プリント可能な箇所が複数あるかを示すフラグ | true |
name | string | Itemの一意な名前 | "t-shirt" |
printPlaceDisplayNames | object | プリント箇所の表示名 | {"front":"前面","back":"背面"} |
printPlaceForExtraAngles | object | {"t-shirt":{"front-wearing-mens":"front","front-wearing-ladies":"front"}} |
|
productImageUrlTemplates | object | 商品の各アングル画像URLのテンプレート | {"front":"https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}\u0026printed={printed}"} |
wearingImageUrls | object | アイテムの着用画像のURL | {"png":"/assets/wearing_by_item/t-shirt.png"} |
Details
全Itemのリストを取得します。
GET /api/v1/items
$ curl -n /api/v1/items
HTTP/1.1 200 OK
{
"items": [
{
"id": 1,
"name": "t-shirt",
"angles": [
1
],
"humanizeName": "スタンダードTシャツ",
"availablePrintPlaces": [
"front",
"back"
],
"defaultPrintPlace": "front",
"displayOrder": 9,
"essentialAngles": [
"front",
"back"
],
"extraAngles": [
"front-wearing-mens",
"front-wearing-ladies"
],
"iconUrls": {
"png": "/assets/items/t-shirt.png"
},
"wearingImageUrls": {
"png": "/assets/wearing_by_item/t-shirt.png"
},
"isMultiPrintable": true,
"printPlaceDisplayNames": {
"front": "前面",
"back": "背面"
},
"printPlaceForExtraAngles": {
"t-shirt": {
"front-wearing-mens": "front",
"front-wearing-ladies": "front"
}
},
"imageDescriptions": [
"",
"",
"男性モデル: 179cm",
"女性モデル: 163cm"
],
"productImageUrlTemplates": {
"front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
},
"variants": [
{
"id": 1,
"price": 2080,
"exemplary": true,
"enabled": true,
"isLightColor": true,
"isDarkColor": true,
"color": {
"id": 1,
"name": "white",
"displayName": "ホワイト",
"rgb": "#ffffff"
},
"size": {
"id": 1,
"name": "s",
"displayName": "S"
},
"printPlaces": [
{
"id": 1,
"place": "front",
"price": 500,
"itemVariantId": 2
}
],
"priceWithTax": 2288
}
]
}
]
}
アイテムのカラー
Details
Name | Type | Description | Example |
---|---|---|---|
displayName | string | アイテムカラーの表示名 | "ホワイト" |
id | integer | アイテムカラーの一意なID | 1 |
name | string | アイテムカラーの一意な名前 | "white" |
rgb | string | アイテムカラーのRGB | "#ffffff" |
アイテムのサイズ
Details
Name | Type | Description | Example |
---|---|---|---|
displayName | string | アイテムサイズの表示名 | "S" |
id | integer | アイテムサイズの一意なID | 1 |
name | string | アイテムサイズの一意な名前 | "s" |
アイテムカラーとアイテムサイズの組み合わせ
Details
Name | Type | Description | Example |
---|---|---|---|
color:displayName | string | アイテムカラーの表示名 | "ホワイト" |
color:id | integer | アイテムカラーの一意なID | 1 |
color:name | string | アイテムカラーの一意な名前 | "white" |
color:rgb | string | アイテムカラーのRGB | "#ffffff" |
enabled | boolean | 有効フラグ | true |
exemplary | boolean | 代表フラグ(代表のアイテムバリエーションが、SUZURIサイトの商品リストページに使用されます) | true |
id | integer | アイテムバリエーションの一意なID | 1 |
isDarkColor | boolean | 濃色フラグ | true |
isLightColor | boolean | 淡色フラグ | true |
price | integer | アイテムバリエーションの価格(税抜)※ 原価を計算したい場合はprintPlacesのpriceを加算してください | 2080 |
priceWithTax | integer | アイテムバリエーションの価格(税込)※ 原価を計算したい場合はprintPlacesのpriceを加算してください | 2288 |
printPlaces | array | [{"id":1,"place":"front","price":500,"itemVariantId":2}] |
|
size:displayName | string | アイテムサイズの表示名 | "S" |
size:id | integer | アイテムサイズの一意なID | 1 |
size:name | string | アイテムサイズの一意な名前 | "s" |
Material(素材)は、Userがアップロードした画像によって生成される、Product(商品)を作るための素材です。ひとつのMaterialからは、Item一種類につき一つずつのProductを作ることができます。Materialから作ることのできる商品の種類は、Item List API を使って取得することができます。
Details
Name | Type | Description | Example |
---|---|---|---|
description | nullable string | Materialの説明 | "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah." |
dominantRgb | nullable string | Materialの主張色のRGB | "#ffffff" |
id | integer | Materialのid | 31106 |
originalHeight | integer | Materialの画像の縦幅 | 1080 |
originalWidth | integer | Materialの画像の横幅 | 1920 |
price | integer | Materialの値段 (いわゆるトリブン)。 | 100 |
priceWithTax | integer | Materialの値段(いわゆるトリブン)の税込価格。 | 110 |
published | boolean | 公開・非公開フラグ (Materialが公開されているときtrue) | true |
publishedAt | nullable date-time | Materialが公開された時間 | "2014-05-07 11:05:25 +0900" |
title | string | Materialのタイトル | "AAスリスリくん" |
uploadedAt | date-time | Materialが更新された時間 | "2014-05-07 11:03:15 +0900" |
user:avatarUrl | nullable string | Userのアバター画像のURL | "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488" |
user:displayName | nullable string | ウェブページなどに表示するUserの名前 | "忍者スリスリくん" |
user:id | integer | Userの一意なID | 1 |
user:name | string | Userの一意な名前 | "surisurikun" |
violation | boolean | 違反フラグ (Materialが規約違反しているかどうか) | false |
Details
Materialの一覧を取得します。
GET /api/v1/materials
Name | Type | Description | Example |
---|---|---|---|
limit | string | 取得するMaterialの数を指定します(デフォルトは20、最大50) pattern: [1-9]|[1-4][0-9]|50$ | 30 |
offset | string | 取得するMaterialの開始位置を指定します。 pattern: [0-9][0-9]*$ | 100 |
userId | string | 取得するProductを Userのid で絞り込む pattern: [1-9][0-9]*$ | 2 |
$ curl -n /api/v1/materials
-G \
-d limit=30 \
-d offset=100 \
-d userId=2
HTTP/1.1 200 OK
{
"materials": [
{
"id": 31106,
"title": "AAスリスリくん",
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"price": 100,
"priceWithTax": 110,
"violation": false,
"published": true,
"publishedAt": "2014-05-07 11:05:25 +0900",
"uploadedAt": "2014-05-07 11:03:15 +0900",
"dominantRgb": "#ffffff",
"originalWidth": 1920,
"originalHeight": 1080,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
}
],
"meta": {
"hasNext": true
}
}
Details
画像からMaterialとProductを作ります。レートリミットが設けてあります。
POST /api/v1/materials
Name | Type | Description | Example |
---|---|---|---|
texture | string | Materialの画像URL (データURIでも可) | "https://41.media.tumblr.com/QA9JpdgnOc8ov98s1C4S5EjJ_500.jpg" |
title | string | Materialのタイトル | "AAスリスリくん" |
Name | Type | Description | Example |
---|---|---|---|
description | nullable string | Materialの説明 | "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah." |
price | integer | Materialの値段 (いわゆるトリブン)。 | 100 |
products/exemplaryItemVariantId | integer | 作るProductの代表的なItem Variant(色とサイズの組み合わせ)のid | 151 |
products/itemId | integer | 作るProductのItemのid | 1 |
products/published | boolean | 作ったProductを公開する場合はtrue | true |
products/resizeMode | nullable string | 自動でリサイズするオプションです。contain を指定すると、プリント領域にぴったり収まるように画像を拡大・縮小します。cover を指定すると、できるだけプリント領域をちょうど埋めるように画像を拡大・縮小します。(cover は、スマホケース、ノート、フルグラフィックTシャツでのみ有効) |
"contain" |
products/sub_materials/enabled | boolean | 有効にする場合はtrue | true |
products/sub_materials/printSide | string | SubMaterial のプリント箇所を指定します。商品によって選択可能なプリント箇所が異なります。 | "back" |
products/sub_materials/texture | string | SubMaterialの画像URL (データURIでも可) | "https://41.media.tumblr.com/QA9JpdgnOc8ov98s1C4S5EjJ_500.jpg" |
$ curl -n -X POST /api/v1/materials \
-d '{
"texture": "https://41.media.tumblr.com/QA9JpdgnOc8ov98s1C4S5EjJ_500.jpg",
"title": "AAスリスリくん",
"price": 100,
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"products": [
{
"itemId": 1,
"exemplaryItemVariantId": 151,
"published": true,
"resizeMode": "contain",
"sub_materials": [
{
"texture": "https://41.media.tumblr.com/QA9JpdgnOc8ov98s1C4S5EjJ_500.jpg",
"printSide": "back",
"enabled": true
}
]
}
]
}' \
-H "Content-Type: application/json"
HTTP/1.1 200 OK
{
"material": {
"id": 31106,
"title": "AAスリスリくん",
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"price": 100,
"priceWithTax": 110,
"violation": false,
"published": true,
"publishedAt": "2014-05-07 11:05:25 +0900",
"uploadedAt": "2014-05-07 11:03:15 +0900",
"dominantRgb": "#ffffff",
"originalWidth": 1920,
"originalHeight": 1080,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
},
"products": [
{
"id": 1,
"title": "AAスリスリくん スタンダードTシャツ",
"published": true,
"publishedAt": "2015-01-14 11:58:29 +0900",
"createdAt": "2015-01-14 11:58:29 +0900",
"updatedAt": "2015-01-14 11:58:29 +0900",
"examplaryAngle": "back",
"imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
"sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
"priceWithTax": 2080,
"discountedPriceWithTax": 2288,
"item": {
"id": 1,
"name": "t-shirt",
"angles": [
1
],
"humanizeName": "スタンダードTシャツ",
"availablePrintPlaces": [
"front",
"back"
],
"defaultPrintPlace": "front",
"displayOrder": 9,
"essentialAngles": [
"front",
"back"
],
"extraAngles": [
"front-wearing-mens",
"front-wearing-ladies"
],
"iconUrls": {
"png": "/assets/items/t-shirt.png"
},
"wearingImageUrls": {
"png": "/assets/wearing_by_item/t-shirt.png"
},
"isMultiPrintable": true,
"printPlaceDisplayNames": {
"front": "前面",
"back": "背面"
},
"printPlaceForExtraAngles": {
"t-shirt": {
"front-wearing-mens": "front",
"front-wearing-ladies": "front"
}
},
"imageDescriptions": [
"",
"",
"男性モデル: 179cm",
"女性モデル: 163cm"
],
"productImageUrlTemplates": {
"front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
}
},
"material": {
"id": 31106,
"title": "AAスリスリくん",
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"price": 100,
"priceWithTax": 110,
"violation": false,
"published": true,
"publishedAt": "2014-05-07 11:05:25 +0900",
"uploadedAt": "2014-05-07 11:03:15 +0900",
"dominantRgb": "#ffffff",
"originalWidth": 1920,
"originalHeight": 1080,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
},
"sampleItemVariant": {
"id": 1,
"price": 2080,
"exemplary": true,
"enabled": true,
"isLightColor": true,
"isDarkColor": true,
"color": {
"id": 1,
"name": "white",
"displayName": "ホワイト",
"rgb": "#ffffff"
},
"size": {
"id": 1,
"name": "s",
"displayName": "S"
},
"printPlaces": [
{
"id": 1,
"place": "front",
"price": 500,
"itemVariantId": 2
}
],
"priceWithTax": 2288
}
}
]
}
Details
MaterialおよびProductの情報を更新します。Productsパラメータを指定した場合、このMaterialと指定したitemIdから成るProductがすでに存在する場合はProductの更新操作となり、存在しない場合はProductの作成操作となります。レートリミットが設けてあります
PUT /api/v1/materials/{material_id}
Name | Type | Description | Example |
---|---|---|---|
description | nullable string | Materialの説明 | "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah." |
price | integer | Materialの値段 (いわゆるトリブン)。 | 100 |
products/exemplaryItemVariantId | integer | 更新するProductの代表的なItem Variant(色とサイズの組み合わせ)のid | 151 |
products/itemId | integer | 更新するProductのItemのid | 1 |
products/published | boolean | trueだと公開、falseだと非公開 | true |
products/resizeMode | nullable string | 自動でリサイズするオプション。contain を指定すると、プリント領域にぴったり収まるように画像を拡大・縮小 |
"contain" |
title | string | Materialのタイトル | "AAスリスリくん" |
$ curl -n -X PUT /api/v1/materials/$MATERIAL_ID \
-d '{
"title": "AAスリスリくん",
"price": 100,
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"products": [
{
"itemId": 1,
"exemplaryItemVariantId": 151,
"published": true,
"resizeMode": "contain"
}
]
}' \
-H "Content-Type: application/json"
HTTP/1.1 200 OK
{
"material": {
"id": 31106,
"title": "AAスリスリくん",
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"price": 100,
"priceWithTax": 110,
"violation": false,
"published": true,
"publishedAt": "2014-05-07 11:05:25 +0900",
"uploadedAt": "2014-05-07 11:03:15 +0900",
"dominantRgb": "#ffffff",
"originalWidth": 1920,
"originalHeight": 1080,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
},
"products": [
{
"id": 1,
"title": "AAスリスリくん スタンダードTシャツ",
"published": true,
"publishedAt": "2015-01-14 11:58:29 +0900",
"createdAt": "2015-01-14 11:58:29 +0900",
"updatedAt": "2015-01-14 11:58:29 +0900",
"examplaryAngle": "back",
"imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
"sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
"priceWithTax": 2080,
"discountedPriceWithTax": 2288,
"item": {
"id": 1,
"name": "t-shirt",
"angles": [
1
],
"humanizeName": "スタンダードTシャツ",
"availablePrintPlaces": [
"front",
"back"
],
"defaultPrintPlace": "front",
"displayOrder": 9,
"essentialAngles": [
"front",
"back"
],
"extraAngles": [
"front-wearing-mens",
"front-wearing-ladies"
],
"iconUrls": {
"png": "/assets/items/t-shirt.png"
},
"wearingImageUrls": {
"png": "/assets/wearing_by_item/t-shirt.png"
},
"isMultiPrintable": true,
"printPlaceDisplayNames": {
"front": "前面",
"back": "背面"
},
"printPlaceForExtraAngles": {
"t-shirt": {
"front-wearing-mens": "front",
"front-wearing-ladies": "front"
}
},
"imageDescriptions": [
"",
"",
"男性モデル: 179cm",
"女性モデル: 163cm"
],
"productImageUrlTemplates": {
"front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
}
},
"material": {
"id": 31106,
"title": "AAスリスリくん",
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"price": 100,
"priceWithTax": 110,
"violation": false,
"published": true,
"publishedAt": "2014-05-07 11:05:25 +0900",
"uploadedAt": "2014-05-07 11:03:15 +0900",
"dominantRgb": "#ffffff",
"originalWidth": 1920,
"originalHeight": 1080,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
},
"sampleItemVariant": {
"id": 1,
"price": 2080,
"exemplary": true,
"enabled": true,
"isLightColor": true,
"isDarkColor": true,
"color": {
"id": 1,
"name": "white",
"displayName": "ホワイト",
"rgb": "#ffffff"
},
"size": {
"id": 1,
"name": "s",
"displayName": "S"
},
"printPlaces": [
{
"id": 1,
"place": "front",
"price": 500,
"itemVariantId": 2
}
],
"priceWithTax": 2288
}
}
]
}
Details
Materialを削除します。紐付いたProductsもすべて削除されます。成功した時は204を返します。
DELETE /api/v1/materials/{material_id}
$ curl -n -X DELETE /api/v1/materials/$MATERIAL_ID \
-H "Content-Type: application/json"
HTTP/1.1 204 No Content
レスポンスヘッダのみ返します
Details
テキストからMaterialとスタンダードTシャツを作ります。レートリミットが設けてあります。
POST /api/v1/materials/text
Name | Type | Description | Example |
---|---|---|---|
text | string | Materialの元となるテキスト。255文字以下です。 | "AAスリスリくん" |
Name | Type | Description | Example |
---|---|---|---|
itemVariantId | integer | 作るスタンダードTシャツのItemVariantId。スタンダードTシャツのItemVariant以外はエラーとなります。利用できる値については、ItemList API を参照してください。指定されなかった場合、白のMで作られます。 |
1 |
$ curl -n -X POST /api/v1/materials/text \
-d '{
"text": "AAスリスリくん",
"itemVariantId": 1
}' \
-H "Content-Type: application/json"
HTTP/1.1 200 OK
{
"material": {
"id": 31106,
"title": "AAスリスリくん",
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"price": 100,
"priceWithTax": 110,
"violation": false,
"published": true,
"publishedAt": "2014-05-07 11:05:25 +0900",
"uploadedAt": "2014-05-07 11:03:15 +0900",
"dominantRgb": "#ffffff",
"originalWidth": 1920,
"originalHeight": 1080,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
},
"products": [
{
"id": 1,
"title": "AAスリスリくん スタンダードTシャツ",
"published": true,
"publishedAt": "2015-01-14 11:58:29 +0900",
"createdAt": "2015-01-14 11:58:29 +0900",
"updatedAt": "2015-01-14 11:58:29 +0900",
"examplaryAngle": "back",
"imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
"sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
"priceWithTax": 2080,
"discountedPriceWithTax": 2288,
"item": {
"id": 1,
"name": "t-shirt",
"angles": [
1
],
"humanizeName": "スタンダードTシャツ",
"availablePrintPlaces": [
"front",
"back"
],
"defaultPrintPlace": "front",
"displayOrder": 9,
"essentialAngles": [
"front",
"back"
],
"extraAngles": [
"front-wearing-mens",
"front-wearing-ladies"
],
"iconUrls": {
"png": "/assets/items/t-shirt.png"
},
"wearingImageUrls": {
"png": "/assets/wearing_by_item/t-shirt.png"
},
"isMultiPrintable": true,
"printPlaceDisplayNames": {
"front": "前面",
"back": "背面"
},
"printPlaceForExtraAngles": {
"t-shirt": {
"front-wearing-mens": "front",
"front-wearing-ladies": "front"
}
},
"imageDescriptions": [
"",
"",
"男性モデル: 179cm",
"女性モデル: 163cm"
],
"productImageUrlTemplates": {
"front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
}
},
"material": {
"id": 31106,
"title": "AAスリスリくん",
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"price": 100,
"priceWithTax": 110,
"violation": false,
"published": true,
"publishedAt": "2014-05-07 11:05:25 +0900",
"uploadedAt": "2014-05-07 11:03:15 +0900",
"dominantRgb": "#ffffff",
"originalWidth": 1920,
"originalHeight": 1080,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
},
"sampleItemVariant": {
"id": 1,
"price": 2080,
"exemplary": true,
"enabled": true,
"isLightColor": true,
"isDarkColor": true,
"color": {
"id": 1,
"name": "white",
"displayName": "ホワイト",
"rgb": "#ffffff"
},
"size": {
"id": 1,
"name": "s",
"displayName": "S"
},
"printPlaces": [
{
"id": 1,
"place": "front",
"price": 500,
"itemVariantId": 2
}
],
"priceWithTax": 2288
}
}
]
}
プリント加工可能な箇所
Details
Name | Type | Description | Example |
---|---|---|---|
id | integer | プリント箇所の一意なID | 1 |
itemVariantId | integer | 関連するアイテムバリエーションの一意なID | 2 |
place | string | プリント箇所の名称 | "front" |
price | integer | この箇所にプリントした場合に加算される価格 | 500 |
Productは、Materialから生まれた各商品のことです。商品の値段は material:price と itemVariant:price によって決定されます。
Details
Name | Type | Description | Example |
---|---|---|---|
createdAt | date-time | Product作成された時間 | "2015-01-14 11:58:29 +0900" |
discountedPriceWithTax | integer | 値引後の商品の税込価格 | 2288 |
examplaryAngle | nullable string | Productの代表的角度(SUZURIのウェブサイトで使用されます) | "back" |
id | integer | Productの一意なID | 1 |
imageUrl | string | Product画像のURL。{} で囲まれた箇所は変数です。 次の値を入れて使用してください。{width}x{height} に画像のサイズ。(有効な値は 323x323 、765x765 ) {size}/{color} にアイテムサイズ/カラーの名前、[/angle] にはアングルの名前または空文字。 (有効な組み合わせは itemVariantsを参照) |
"https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b" |
item:angles | array | Itemの画像におけるアングルの種類 | [1] |
item:availablePrintPlaces | array | プリント可能な箇所 | ["front","back"] |
item:defaultPrintPlace | string | デフォルトのプリント箇所 | "front" |
item:displayOrder | integer | アイテム一覧に表示する際の並び順 | 9 |
item:essentialAngles | array | 一覧に表示するアングルとして選べる角度 | ["front","back"] |
item:extraAngles | array | 一覧に表示するアングルとして選択できない角度 | ["front-wearing-mens","front-wearing-ladies"] |
item:humanizeName | string | Itemを表す名前 | "スタンダードTシャツ" |
item:iconUrls | object | アイテムアイコンのURL | {"png":"/assets/items/t-shirt.png"} |
item:id | integer | Itemのid | 1 |
item:imageDescriptions | array | 商品ページの各画像の説明 | ["","","男性モデル: 179cm","女性モデル: 163cm"] |
item:isMultiPrintable | boolean | プリント可能な箇所が複数あるかを示すフラグ | true |
item:name | string | Itemの一意な名前 | "t-shirt" |
item:printPlaceDisplayNames | object | プリント箇所の表示名 | {"front":"前面","back":"背面"} |
item:printPlaceForExtraAngles | object | {"t-shirt":{"front-wearing-mens":"front","front-wearing-ladies":"front"}} |
|
item:productImageUrlTemplates | object | 商品の各アングル画像URLのテンプレート | {"front":"https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}\u0026printed={printed}"} |
item:wearingImageUrls | object | アイテムの着用画像のURL | {"png":"/assets/wearing_by_item/t-shirt.png"} |
material:description | nullable string | Materialの説明 | "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah." |
material:dominantRgb | nullable string | Materialの主張色のRGB | "#ffffff" |
material:id | integer | Materialのid | 31106 |
material:originalHeight | integer | Materialの画像の縦幅 | 1080 |
material:originalWidth | integer | Materialの画像の横幅 | 1920 |
material:price | integer | Materialの値段 (いわゆるトリブン)。 | 100 |
material:priceWithTax | integer | Materialの値段(いわゆるトリブン)の税込価格。 | 110 |
material:published | boolean | 公開・非公開フラグ (Materialが公開されているときtrue) | true |
material:publishedAt | nullable date-time | Materialが公開された時間 | "2014-05-07 11:05:25 +0900" |
material:title | string | Materialのタイトル | "AAスリスリくん" |
material:uploadedAt | date-time | Materialが更新された時間 | "2014-05-07 11:03:15 +0900" |
material:user:avatarUrl | nullable string | Userのアバター画像のURL | "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488" |
material:user:displayName | nullable string | ウェブページなどに表示するUserの名前 | "忍者スリスリくん" |
material:user:id | integer | Userの一意なID | 1 |
material:user:name | string | Userの一意な名前 | "surisurikun" |
material:violation | boolean | 違反フラグ (Materialが規約違反しているかどうか) | false |
priceWithTax | integer | 商品の税込価格 | 2080 |
published | boolean | 公開フラグ (公開されていれば真) | true |
publishedAt | nullable date-time | Productが公開された時間 | "2015-01-14 11:58:29 +0900" |
sampleImageUrl | string | Product画像URLのサンプル | "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b" |
sampleItemVariant:color:displayName | string | アイテムカラーの表示名 | "ホワイト" |
sampleItemVariant:color:id | integer | アイテムカラーの一意なID | 1 |
sampleItemVariant:color:name | string | アイテムカラーの一意な名前 | "white" |
sampleItemVariant:color:rgb | string | アイテムカラーのRGB | "#ffffff" |
sampleItemVariant:enabled | boolean | 有効フラグ | true |
sampleItemVariant:exemplary | boolean | 代表フラグ(代表のアイテムバリエーションが、SUZURIサイトの商品リストページに使用されます) | true |
sampleItemVariant:id | integer | アイテムバリエーションの一意なID | 1 |
sampleItemVariant:isDarkColor | boolean | 濃色フラグ | true |
sampleItemVariant:isLightColor | boolean | 淡色フラグ | true |
sampleItemVariant:price | integer | アイテムバリエーションの価格(税抜)※ 原価を計算したい場合はprintPlacesのpriceを加算してください | 2080 |
sampleItemVariant:priceWithTax | integer | アイテムバリエーションの価格(税込)※ 原価を計算したい場合はprintPlacesのpriceを加算してください | 2288 |
sampleItemVariant:printPlaces | array | [{"id":1,"place":"front","price":500,"itemVariantId":2}] |
|
sampleItemVariant:size:displayName | string | アイテムサイズの表示名 | "S" |
sampleItemVariant:size:id | integer | アイテムサイズの一意なID | 1 |
sampleItemVariant:size:name | string | アイテムサイズの一意な名前 | "s" |
sampleUrl | string | ProductページURLのサンプル | "https://suzuri.jp/surisurikun/31106/t-shirt/s/white" |
title | string | Productのタイトル | "AAスリスリくん スタンダードTシャツ" |
updatedAt | date-time | Productが更新された時間 | "2015-01-14 11:58:29 +0900" |
url | string | ProductのWebページのURL。{} で囲まれた箇所は変数です。 {size}/{color} にアイテムサイズ/カラーの名前を入れて使用してください。(有効な組み合わせは itemVariantsを参照) |
"https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}" |
Details
複数のProduct情報を取得します。
GET /api/v1/products
Name | Type | Description | Example |
---|---|---|---|
itemId | string | 取得するProductをItemのIDで絞り込む pattern: [1-9][0-9]*$ | 1 |
limit | string | 取得するProductの数を指定します(デフォルトは20、最大50) pattern: [1-9]|[1-4][0-9]|50$ | 30 |
materialId | string | 取得するProductを Material id で絞り込む pattern: [1-9][0-9]*$ | 101 |
offset | string | 取得するProductの開始位置を指定します。 pattern: [0-9][0-9]*$ | 100 |
userId | string | 取得するProductを User id で絞り込む pattern: [1-9][0-9]*$ | 2 |
userName | string | 取得するProductを User name で絞り込む pattern: [\w-]*$ | "surisurikun" |
$ curl -n /api/v1/products
-G \
-d itemId=1 \
-d limit=30 \
-d offset=100 \
-d userId=2 \
-d userName=surisurikun \
-d materialId=101
HTTP/1.1 200 OK
{
"products": [
{
"id": 1,
"title": "AAスリスリくん スタンダードTシャツ",
"published": true,
"publishedAt": "2015-01-14 11:58:29 +0900",
"createdAt": "2015-01-14 11:58:29 +0900",
"updatedAt": "2015-01-14 11:58:29 +0900",
"examplaryAngle": "back",
"imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
"sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
"priceWithTax": 2080,
"discountedPriceWithTax": 2288,
"item": {
"id": 1,
"name": "t-shirt",
"angles": [
1
],
"humanizeName": "スタンダードTシャツ",
"availablePrintPlaces": [
"front",
"back"
],
"defaultPrintPlace": "front",
"displayOrder": 9,
"essentialAngles": [
"front",
"back"
],
"extraAngles": [
"front-wearing-mens",
"front-wearing-ladies"
],
"iconUrls": {
"png": "/assets/items/t-shirt.png"
},
"wearingImageUrls": {
"png": "/assets/wearing_by_item/t-shirt.png"
},
"isMultiPrintable": true,
"printPlaceDisplayNames": {
"front": "前面",
"back": "背面"
},
"printPlaceForExtraAngles": {
"t-shirt": {
"front-wearing-mens": "front",
"front-wearing-ladies": "front"
}
},
"imageDescriptions": [
"",
"",
"男性モデル: 179cm",
"女性モデル: 163cm"
],
"productImageUrlTemplates": {
"front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
}
},
"material": {
"id": 31106,
"title": "AAスリスリくん",
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"price": 100,
"priceWithTax": 110,
"violation": false,
"published": true,
"publishedAt": "2014-05-07 11:05:25 +0900",
"uploadedAt": "2014-05-07 11:03:15 +0900",
"dominantRgb": "#ffffff",
"originalWidth": 1920,
"originalHeight": 1080,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
},
"sampleItemVariant": {
"id": 1,
"price": 2080,
"exemplary": true,
"enabled": true,
"isLightColor": true,
"isDarkColor": true,
"color": {
"id": 1,
"name": "white",
"displayName": "ホワイト",
"rgb": "#ffffff"
},
"size": {
"id": 1,
"name": "s",
"displayName": "S"
},
"printPlaces": [
{
"id": 1,
"place": "front",
"price": 500,
"itemVariantId": 2
}
],
"priceWithTax": 2288
}
}
],
"meta": {
"hasNext": true
}
}
Details
指定したChoiceのProduct情報を取得します。
GET /api/v1/choices/{choice_id}/products
Name | Type | Description | Example |
---|---|---|---|
limit | string | 取得するProductの数を指定します(デフォルトは20、最大50) pattern: [1-9]|[1-4][0-9]|50$ | 30 |
offset | string | 取得するProductの開始位置を指定します。 pattern: [0-9][0-9]*$ | 100 |
$ curl -n /api/v1/choices/$CHOICE_ID/products
-G \
-d limit=30 \
-d offset=100
HTTP/1.1 200 OK
{
"products": [
{
"id": 1,
"title": "AAスリスリくん スタンダードTシャツ",
"published": true,
"publishedAt": "2015-01-14 11:58:29 +0900",
"createdAt": "2015-01-14 11:58:29 +0900",
"updatedAt": "2015-01-14 11:58:29 +0900",
"examplaryAngle": "back",
"imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
"sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
"priceWithTax": 2080,
"discountedPriceWithTax": 2288,
"item": {
"id": 1,
"name": "t-shirt",
"angles": [
1
],
"humanizeName": "スタンダードTシャツ",
"availablePrintPlaces": [
"front",
"back"
],
"defaultPrintPlace": "front",
"displayOrder": 9,
"essentialAngles": [
"front",
"back"
],
"extraAngles": [
"front-wearing-mens",
"front-wearing-ladies"
],
"iconUrls": {
"png": "/assets/items/t-shirt.png"
},
"wearingImageUrls": {
"png": "/assets/wearing_by_item/t-shirt.png"
},
"isMultiPrintable": true,
"printPlaceDisplayNames": {
"front": "前面",
"back": "背面"
},
"printPlaceForExtraAngles": {
"t-shirt": {
"front-wearing-mens": "front",
"front-wearing-ladies": "front"
}
},
"imageDescriptions": [
"",
"",
"男性モデル: 179cm",
"女性モデル: 163cm"
],
"productImageUrlTemplates": {
"front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
}
},
"material": {
"id": 31106,
"title": "AAスリスリくん",
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"price": 100,
"priceWithTax": 110,
"violation": false,
"published": true,
"publishedAt": "2014-05-07 11:05:25 +0900",
"uploadedAt": "2014-05-07 11:03:15 +0900",
"dominantRgb": "#ffffff",
"originalWidth": 1920,
"originalHeight": 1080,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
},
"sampleItemVariant": {
"id": 1,
"price": 2080,
"exemplary": true,
"enabled": true,
"isLightColor": true,
"isDarkColor": true,
"color": {
"id": 1,
"name": "white",
"displayName": "ホワイト",
"rgb": "#ffffff"
},
"size": {
"id": 1,
"name": "s",
"displayName": "S"
},
"printPlaces": [
{
"id": 1,
"place": "front",
"price": 500,
"itemVariantId": 2
}
],
"priceWithTax": 2288
}
}
],
"meta": {
"hasNext": true
}
}
Details
Productをキーワード検索します。
GET /api/v1/products/search
Name | Type | Description | Example |
---|---|---|---|
itemId | string | 取得するProductをItemのIDで絞り込む pattern: [1-9][0-9]*$ | 1 |
limit | string | 取得するProductの数を指定します(デフォルトは20、最大50) pattern: [1-9]|[1-4][0-9]|50$ | 30 |
offset | string | 取得するProductの開始位置を指定します。 pattern: [0-9][0-9]*$ | 100 |
q | string | 検索キーワード Length: 0..100 |
"NINJYA" |
$ curl -n /api/v1/products/search
-G \
-d limit=30 \
-d offset=100 \
-d q=NINJYA \
-d itemId=1
HTTP/1.1 200 OK
{
"products": [
{
"id": 1,
"title": "AAスリスリくん スタンダードTシャツ",
"published": true,
"publishedAt": "2015-01-14 11:58:29 +0900",
"createdAt": "2015-01-14 11:58:29 +0900",
"updatedAt": "2015-01-14 11:58:29 +0900",
"examplaryAngle": "back",
"imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
"sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
"priceWithTax": 2080,
"discountedPriceWithTax": 2288,
"item": {
"id": 1,
"name": "t-shirt",
"angles": [
1
],
"humanizeName": "スタンダードTシャツ",
"availablePrintPlaces": [
"front",
"back"
],
"defaultPrintPlace": "front",
"displayOrder": 9,
"essentialAngles": [
"front",
"back"
],
"extraAngles": [
"front-wearing-mens",
"front-wearing-ladies"
],
"iconUrls": {
"png": "/assets/items/t-shirt.png"
},
"wearingImageUrls": {
"png": "/assets/wearing_by_item/t-shirt.png"
},
"isMultiPrintable": true,
"printPlaceDisplayNames": {
"front": "前面",
"back": "背面"
},
"printPlaceForExtraAngles": {
"t-shirt": {
"front-wearing-mens": "front",
"front-wearing-ladies": "front"
}
},
"imageDescriptions": [
"",
"",
"男性モデル: 179cm",
"女性モデル: 163cm"
],
"productImageUrlTemplates": {
"front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
}
},
"material": {
"id": 31106,
"title": "AAスリスリくん",
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"price": 100,
"priceWithTax": 110,
"violation": false,
"published": true,
"publishedAt": "2014-05-07 11:05:25 +0900",
"uploadedAt": "2014-05-07 11:03:15 +0900",
"dominantRgb": "#ffffff",
"originalWidth": 1920,
"originalHeight": 1080,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
},
"sampleItemVariant": {
"id": 1,
"price": 2080,
"exemplary": true,
"enabled": true,
"isLightColor": true,
"isDarkColor": true,
"color": {
"id": 1,
"name": "white",
"displayName": "ホワイト",
"rgb": "#ffffff"
},
"size": {
"id": 1,
"name": "s",
"displayName": "S"
},
"printPlaces": [
{
"id": 1,
"place": "front",
"price": 500,
"itemVariantId": 2
}
],
"priceWithTax": 2288
}
}
],
"meta": {
"hasNext": true
}
}
Details
セール対象の商品を取得します
GET /api/v1/products/on_sale
Name | Type | Description | Example |
---|---|---|---|
limit | string | 取得するProductの数を指定します(デフォルトは20、最大50) pattern: [1-9]|[1-4][0-9]|50$ | 30 |
offset | string | 取得するProductの開始位置を指定します。 pattern: [0-9][0-9]*$ | 100 |
$ curl -n /api/v1/products/on_sale
-G \
-d limit=30 \
-d offset=100
HTTP/1.1 200 OK
{
"products": [
{
"id": 1,
"title": "AAスリスリくん スタンダードTシャツ",
"published": true,
"publishedAt": "2015-01-14 11:58:29 +0900",
"createdAt": "2015-01-14 11:58:29 +0900",
"updatedAt": "2015-01-14 11:58:29 +0900",
"examplaryAngle": "back",
"imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
"sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
"priceWithTax": 2080,
"discountedPriceWithTax": 2288,
"item": {
"id": 1,
"name": "t-shirt",
"angles": [
1
],
"humanizeName": "スタンダードTシャツ",
"availablePrintPlaces": [
"front",
"back"
],
"defaultPrintPlace": "front",
"displayOrder": 9,
"essentialAngles": [
"front",
"back"
],
"extraAngles": [
"front-wearing-mens",
"front-wearing-ladies"
],
"iconUrls": {
"png": "/assets/items/t-shirt.png"
},
"wearingImageUrls": {
"png": "/assets/wearing_by_item/t-shirt.png"
},
"isMultiPrintable": true,
"printPlaceDisplayNames": {
"front": "前面",
"back": "背面"
},
"printPlaceForExtraAngles": {
"t-shirt": {
"front-wearing-mens": "front",
"front-wearing-ladies": "front"
}
},
"imageDescriptions": [
"",
"",
"男性モデル: 179cm",
"女性モデル: 163cm"
],
"productImageUrlTemplates": {
"front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
}
},
"material": {
"id": 31106,
"title": "AAスリスリくん",
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"price": 100,
"priceWithTax": 110,
"violation": false,
"published": true,
"publishedAt": "2014-05-07 11:05:25 +0900",
"uploadedAt": "2014-05-07 11:03:15 +0900",
"dominantRgb": "#ffffff",
"originalWidth": 1920,
"originalHeight": 1080,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
},
"sampleItemVariant": {
"id": 1,
"price": 2080,
"exemplary": true,
"enabled": true,
"isLightColor": true,
"isDarkColor": true,
"color": {
"id": 1,
"name": "white",
"displayName": "ホワイト",
"rgb": "#ffffff"
},
"size": {
"id": 1,
"name": "s",
"displayName": "S"
},
"printPlaces": [
{
"id": 1,
"place": "front",
"price": 500,
"itemVariantId": 2
}
],
"priceWithTax": 2288
}
}
],
"meta": {
"hasNext": true
}
}
Details
idを指定してProduct情報を取得します。
GET /api/v1/products/{product_id}
$ curl -n /api/v1/products/$PRODUCT_ID
HTTP/1.1 200 OK
{
"products": {
"id": 1,
"title": "AAスリスリくん スタンダードTシャツ",
"published": true,
"publishedAt": "2015-01-14 11:58:29 +0900",
"createdAt": "2015-01-14 11:58:29 +0900",
"updatedAt": "2015-01-14 11:58:29 +0900",
"examplaryAngle": "back",
"imageUrl": "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"sampleImageUrl": "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b",
"url": "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}",
"sampleUrl": "https://suzuri.jp/surisurikun/31106/t-shirt/s/white",
"item": {
"id": 1,
"name": "t-shirt",
"angles": [
1
],
"humanizeName": "スタンダードTシャツ",
"availablePrintPlaces": [
"front",
"back"
],
"defaultPrintPlace": "front",
"displayOrder": 9,
"essentialAngles": [
"front",
"back"
],
"extraAngles": [
"front-wearing-mens",
"front-wearing-ladies"
],
"iconUrls": {
"png": "/assets/items/t-shirt.png"
},
"wearingImageUrls": {
"png": "/assets/wearing_by_item/t-shirt.png"
},
"isMultiPrintable": true,
"printPlaceDisplayNames": {
"front": "前面",
"back": "背面"
},
"printPlaceForExtraAngles": {
"t-shirt": {
"front-wearing-mens": "front",
"front-wearing-ladies": "front"
}
},
"imageDescriptions": [
"",
"",
"男性モデル: 179cm",
"女性モデル: 163cm"
],
"productImageUrlTemplates": {
"front": "https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}&printed={printed}"
}
},
"material": {
"id": 31106,
"title": "AAスリスリくん",
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"price": 100,
"priceWithTax": 110,
"violation": false,
"published": true,
"publishedAt": "2014-05-07 11:05:25 +0900",
"uploadedAt": "2014-05-07 11:03:15 +0900",
"dominantRgb": "#ffffff",
"originalWidth": 1920,
"originalHeight": 1080,
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488"
}
},
"itemVariants": [
{
"id": 1,
"price": 2080,
"exemplary": true,
"enabled": true,
"isLightColor": true,
"isDarkColor": true,
"color": {
"id": 1,
"name": "white",
"displayName": "ホワイト",
"rgb": "#ffffff"
},
"size": {
"id": 1,
"name": "s",
"displayName": "S"
},
"printPlaces": [
{
"id": 1,
"place": "front",
"price": 500,
"itemVariantId": 2
}
],
"priceWithTax": 2288
}
],
"sampleItemVariant": {
"id": 1,
"price": 2080,
"exemplary": true,
"enabled": true,
"isLightColor": true,
"isDarkColor": true,
"color": {
"id": 1,
"name": "white",
"displayName": "ホワイト",
"rgb": "#ffffff"
},
"size": {
"id": 1,
"name": "s",
"displayName": "S"
},
"printPlaces": [
{
"id": 1,
"place": "front",
"price": 500,
"itemVariantId": 2
}
],
"priceWithTax": 2288
}
}
}
ユーザのプロフィール
Details
Name | Type | Description | Example |
---|---|---|---|
body | nullable string | プロフィールの詳細 | "こんにちは!SUZURI の公式忍者・スリスリくんです。\\nキミも忍者にならないか?" |
headerUrl | nullable string | ユーザプロフィールページのヘッダ画像URL | "https://dp3obxrw75ln8.cloudfront.net/profiles/headers/10.png?1398245916" |
url | nullable string | ユーザのホームページのURL | "https://suzuri.jp/" |
トップページに掲載するLPやセール情報
Details
Name | Type | Description | Example |
---|---|---|---|
category | string | Promotionのカテゴリー | "lp" |
id | integer | Promotionの一意なID | 1 |
name | string | Promotionの名前 | "jet-cap-sale" |
url | string | PromotionのURL | "https://suzuri.jp/lp/five-panel-cap" |
User(ユーザ)とは、SUZURIのユーザです。
Details
Name | Type | Description | Example |
---|---|---|---|
avatarUrl | nullable string | Userのアバター画像のURL | "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488" |
displayName | nullable string | ウェブページなどに表示するUserの名前 | "忍者スリスリくん" |
id | integer | Userの一意なID | 1 |
identities | array | ユーザが認証に利用した外部サービス | [{"id":1,"provider":"twitter","uid":1181557592,"nickname":"surisurikun","url":"https://twitter.com/surisurikun"}] |
name | string | Userの一意な名前 | "surisurikun" |
official | boolean | 認証バッジフラグ(認証バッジが付与されていたらtrue) | true |
profile:body | nullable string | プロフィールの詳細 | "こんにちは!SUZURI の公式忍者・スリスリくんです。\\nキミも忍者にならないか?" |
profile:headerUrl | nullable string | ユーザプロフィールページのヘッダ画像URL | "https://dp3obxrw75ln8.cloudfront.net/profiles/headers/10.png?1398245916" |
profile:url | nullable string | ユーザのホームページのURL | "https://suzuri.jp/" |
Details
複数のUser情報を取得します。
GET /api/v1/users
Name | Type | Description | Example |
---|---|---|---|
limit | string | 取得するUsertの数を指定します(デフォルトは20、最大50) pattern: [1-9]|[1-4][0-9]|50$ | 30 |
name | string | Userのname pattern: [\w-]*$ | "surisurikun" |
offset | string | 取得するUserの開始位置を指定します。 pattern: [0-9][0-9]*$ | 100 |
$ curl -n /api/v1/users
-G \
-d name=surisurikun \
-d limit=30 \
-d offset=100
HTTP/1.1 200 OK
{
"users": [
{
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488",
"profile": {
"url": "https://suzuri.jp/",
"body": "こんにちは!SUZURI の公式忍者・スリスリくんです。\\nキミも忍者にならないか?",
"headerUrl": "https://dp3obxrw75ln8.cloudfront.net/profiles/headers/10.png?1398245916"
},
"identities": [
{
"id": 1,
"provider": "twitter",
"uid": 1181557592,
"nickname": "surisurikun",
"url": "https://twitter.com/surisurikun"
}
],
"official": true
}
],
"meta": {
"hasNext": true
}
}
Details
idで指定したUserの情報を取得します
GET /api/v1/users/{user_id}
$ curl -n /api/v1/users/$USER_ID
HTTP/1.1 200 OK
{
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488",
"profile": {
"url": "https://suzuri.jp/",
"body": "こんにちは!SUZURI の公式忍者・スリスリくんです。\\nキミも忍者にならないか?",
"headerUrl": "https://dp3obxrw75ln8.cloudfront.net/profiles/headers/10.png?1398245916"
},
"identities": [
{
"id": 1,
"provider": "twitter",
"uid": 1181557592,
"nickname": "surisurikun",
"url": "https://twitter.com/surisurikun"
}
],
"official": true
}
}
Details
認証されたUserの情報を取得します
GET /api/v1/user
$ curl -n /api/v1/user
HTTP/1.1 200 OK
{
"user": {
"id": 1,
"email": "hoge@suzuri.jp",
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488",
"profile": {
"url": "https://suzuri.jp/",
"body": "こんにちは!SUZURI の公式忍者・スリスリくんです。\\nキミも忍者にならないか?",
"headerUrl": "https://dp3obxrw75ln8.cloudfront.net/profiles/headers/10.png?1398245916"
},
"identities": [
{
"id": 1,
"provider": "twitter",
"uid": 1181557592,
"nickname": "surisurikun",
"url": "https://twitter.com/surisurikun"
}
],
"official": true
}
}
Details
認証されたUserの情報を更新します
PUT /api/v1/user
$ curl -n -X PUT /api/v1/user \
-H "Content-Type: application/json"
HTTP/1.1 200 OK
{
"user": {
"id": 1,
"name": "surisurikun",
"displayName": "忍者スリスリくん",
"avatarUrl": "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488",
"profile": {
"url": "https://suzuri.jp/",
"body": "こんにちは!SUZURI の公式忍者・スリスリくんです。\\nキミも忍者にならないか?",
"headerUrl": "https://dp3obxrw75ln8.cloudfront.net/profiles/headers/10.png?1398245916"
},
"identities": [
{
"id": 1,
"provider": "twitter",
"uid": 1181557592,
"nickname": "surisurikun",
"url": "https://twitter.com/surisurikun"
}
],
"official": true
}
}