Welcome to the SUZURI API!
This page describes about SUZURI API v1.
Developers must use HTTPS. Host name is suzuri.jp
There are 4 type of HTTP methods for using SUZURI API, they are GET, POST, PUT, DELETE. Many API allow request including parameters. Developers have to use query string when using GET method, and use application/json type request body when using other methods.
SUZURI API return some status codes. It returns 200 (or 204 with deleting) after operations succeed, and returns 40x or 50x when operations fail. Response body is uncertain when operation fails, so developers should confirm status code first of the all.
There is access ratelimitations some part of API. The informations of limitaion are included in response headers, named X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset.
Requests must include an access token, which is issued by the authentication flow as follows.
Access token should be included in request headers like,
Authorization: Bearer 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd
Curl command samples on this page miss header option above. Therefore, when using curl command in practice, developers should add options like below.
-H "Authorization: Bearer 1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcd"
It is the event that occurred in the SUZURI
Get activities list for current user.
GET /api/v1/activities
Name | Type | Description | Example |
---|---|---|---|
limit | string | limit of Activitys list (default 10) pattern: [1-9]|[1-4][0-9]|50$ | 30 |
$ curl -n -X GET /api/v1/activities
-G \
-d limit=30
HTTP/1.1 200 OK
{
"activities": [
{
"message": "鹿さん が【去年の暮れあたりから蝶がついてきてるモグラ Tシャツ】にズッキュンしたよ。",
"timeago": "2時間前",
"eventType": "favorite",
"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"
}
]
},
"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"
}
]
},
"event": null
}
]
}
Get number of unreads activities
GET /api/v1/activities/unreads
$ curl -n -X GET /api/v1/activities/unreads
HTTP/1.1 200 OK
{
"unreads": 3
}
Choice
Name | Type | Description | Example |
---|---|---|---|
id | integer | unique identifier of Choice | 7 |
title | string | title of Choice | "スリスリピックアップ" |
description | nullable string | description of Choice | "猫の商品を沢山あつめてみました。" |
secret | boolean | flag of secret mode | false |
bannerUrl | nullable uri | url of banner image of choice | "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246" |
productsCount | integer | count of Products included by Choice | 1 |
user:id | integer | unique identifier of User | 1 |
user:name | string | unique name of User | "surisurikun" |
user:displayName | nullable string | descriptive label for User, displayed on the screen | "忍者スリスリくん" |
user:avatarUrl | nullable string | url avatar image of User | "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488" |
get info for Choice selected by id
GET /api/v1/choices/{choice_id}
$ curl -n -X GET /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"
}
}
}
create Choice
POST /api/v1/choices
Name | Type | Description | Example |
---|---|---|---|
title | string | title of Choice | "スリスリピックアップ" |
Name | Type | Description | Example |
---|---|---|---|
description | string | description of Choice | "猫の商品を沢山あつめてみました。" |
bannerUrl | string | url of Choices banner | "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246" |
choiceProducts/productId | integer | unique identifier of product | 1 |
choiceProducts/itemVariantId | integer | unique identifier of item_variant | 1 |
$ curl -n -X POST /api/v1/choices \
-H "Content-Type: application/json" \
\
-d '{
"title": "スリスリピックアップ",
"description": "猫の商品を沢山あつめてみました。",
"bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
"choiceProducts": [
{
"productId": 1,
"itemVariantId": 1
}
]
}'
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"
}
}
}
delete Choice
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
レスポンスヘッダのみ返します
add product to Choice
POST /api/v1/choices/{choice_id}
Name | Type | Description | Example |
---|---|---|---|
productId | integer | id of product which is to be added to Choice Range: 1 <= value |
1 |
itemVariantId | integer | id of item variant (combination of color and size) which is to be binded to product Range: 1 <= value |
1 |
$ curl -n -X POST /api/v1/choices/$CHOICE_ID \
-H "Content-Type: application/json" \
\
-d '{
"productId": 1,
"itemVariantId": 1
}'
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"
}
}
}
remove product from choice
POST /api/v1/choices/{choice_id}/remove
Name | Type | Description | Example |
---|---|---|---|
productId | integer | id of product which is to be removed from Choice Range: 1 <= value |
1 |
itemVariantId | integer | id of item variant which is to be binded to product Range: 1 <= value |
1 |
$ curl -n -X POST /api/v1/choices/$CHOICE_ID/remove \
-H "Content-Type: application/json" \
\
-d '{
"productId": 1,
"itemVariantId": 1
}'
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"
}
}
}
update Choice
PUT /api/v1/choices/{choice_id}/
Name | Type | Description | Example |
---|---|---|---|
title | string | title of Choice | "スリスリピックアップ" |
description | nullable string | description of Choice | "猫の商品を沢山あつめてみました。" |
bannerUrl | nullable uri | url of banner image of choice | "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246" |
choiceProducts/productId | integer | unique identifier of product | 1 |
choiceProducts/itemVariantId | integer | unique identifier of item_variant | 1 |
$ curl -n -X PUT /api/v1/choices/$CHOICE_ID/ \
-H "Content-Type: application/json" \
\
-d '{
"title": "スリスリピックアップ",
"description": "猫の商品を沢山あつめてみました。",
"bannerUrl": "https://dp3obxrw75ln8.cloudfront.net/choices/banners/7.jpg?1415260246",
"choiceProducts": [
{
"productId": 1,
"itemVariantId": 1
}
]
}'
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"
}
}
}
choices list
GET /api/v1/choices
Name | Type | Description | Example |
---|---|---|---|
limit | string | limit of Choice list (default 20) pattern: [1-9]|[1-4][0-9]|50$ | 15 |
offset | string | offset of list (default is 0, higher number is older) pattern: [0-9][0-9]*$ | 100 |
userId | string | filtering list by User id of Choice owner pattern: [1-9][0-9]*$ | 2 |
userName | string | filtering list by User name of Choice owner pattern: [\w-]*$ | "surisurikun" |
$ curl -n -X GET /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 is users action of favoring Product (like facebook's like or twitter's favorite)
Name | Type | Description | Example |
---|---|---|---|
id | integer | unique identifier of Favrotie | 7 |
count | integer | Favorite count | 3 |
productId | integer | id of product which is favored | 14 |
get Favorites info of specific product
GET /api/v1/products/{product_id}/favorites
Name | Type | Description | Example |
---|---|---|---|
itemId | string | name of Item pattern: [1-9][0-9]*$ | 1 |
limit | string | limit of Favorite list (default 20) pattern: [1-9]|[1-4][0-9]|50$ | 30 |
offset | string | offset of Favorite list pattern: [0-9][0-9]*$ | 100 |
$ curl -n -X GET /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
}
}
get Favorites info of specific User
GET /api/v1/users/{user_id}/favorites
$ curl -n -X GET /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",
"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/png/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,
"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
}
]
}
}
}
],
"meta": {
"hasNext": true
}
}
create Favorite to Product
POST /api/v1/products/{product_id}/favorites
Name | Type | Description | Example |
---|---|---|---|
anonymouse | boolean | If you need anonymouse favorite, set true | true |
count | integer | Favorite count of updates (max: 100) | 10 |
$ curl -n -X POST /api/v1/products/$PRODUCT_ID/favorites \
-H "Content-Type: application/json" \
\
-d '{
"anonymouse": true,
"count": 10
}'
HTTP/1.1 201 Created
{
"favorite": {
"id": 7,
"count": 3,
"rotation": 138,
"x": 0.5702,
"y": 0.5702
},
"meta": {
"totalCount": 10
}
}
Delete favorite.
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
}
Item is a product type we can create in SUZURI. For example, there is the item of 'T-Shirt' or 'Mug'.
Name | Type | Description | Example |
---|---|---|---|
id | integer | unique identifier of Item | 1 |
name | string | unique name of Item | "t-shirt" |
angles | array | angles of Item (used when generate item image) | [1] |
humanizeName | string | descriptive label for Item, displayed on the screen | "Tシャツ" |
availablePrintPlaces | array | printable places | ["front","back"] |
defaultPrintPlace | string | print place which is selected as exemplary by default | "front" |
displayOrder | integer | sort order for displaying items list | 9 |
essentialAngles | array | angles that can be selected as the examplary angle | ["front","back"] |
extraAngles | array | angles that cannot be selected as the exemplary angle | ["front-wearing-mens","front-wearing-ladies"] |
iconUrls | object | URLs of item icon | {"png":"/assets/items/png/t-shirt.png"} |
isMultiPrintable | boolean | the item has two or more printable places or not | true |
printPlaceDisplayNames | object | descriptive names for each print places | {"front":"前面","back":"背面"} |
printPlaceForExtraAngles | object | {"t-shirt":{"front-wearing-mens":"front","front-wearing-ladies":"front"}} |
|
imageDescriptions | array | image descriptions on product page | ["","","男性モデル: 179cm","女性モデル: 163cm"] |
productImageUrlTemplates | object | URL templates of product image for each angles | {"front":"https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}\u0026printed={printed}"} |
get all Item list
GET /api/v1/items
$ curl -n -X GET /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/png/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
}
]
}
]
}
]
}
Material is a material for create Product. Material is generated from image file uploaded by User
Name | Type | Description | Example |
---|---|---|---|
id | integer | unique identifier of Material | 31106 |
title | string | title of Material | "AAスリスリくん" |
description | nullable string | description of Material | "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah." |
price | integer | price of Material (will be added to the price of item variant) | 100 |
violation | boolean | true when the material go violate the rules | false |
published | boolean | true when the material go be published | true |
publishedAt | nullable date-time | when material was published | "2014-05-07 11:05:25 +0900" |
uploadedAt | date-time | when material was uploaded | "2014-05-07 11:03:15 +0900" |
dominantRgb | nullable string | dominant color RGB of material | "#ffffff" |
originalWidth | integer | original width of Material | 1920 |
originalHeight | integer | original height of Material | 1080 |
user:id | integer | unique identifier of User | 1 |
user:name | string | unique name of User | "surisurikun" |
user:displayName | nullable string | descriptive label for User, displayed on the screen | "忍者スリスリくん" |
user:avatarUrl | nullable string | url avatar image of User | "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488" |
get Material list
GET /api/v1/materials
Name | Type | Description | Example |
---|---|---|---|
limit | string | limit of Materials list (default 20) pattern: [1-9]|[1-4][0-9]|50$ | 30 |
offset | string | offset of Materials list pattern: [0-9][0-9]*$ | 100 |
userId | string | filtering list by User id of Material owner pattern: [1-9][0-9]*$ | 2 |
$ curl -n -X GET /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,
"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
}
}
create Material & Products by from image
POST /api/v1/materials
Name | Type | Description | Example |
---|---|---|---|
texture | string | url of texture image of material (data uri is OK) | "https://41.media.tumblr.com/QA9JpdgnOc8ov98s1C4S5EjJ_500.jpg" |
title | string | title of Material | "AAスリスリくん" |
Name | Type | Description | Example |
---|---|---|---|
price | integer | price of Material (will be added to the price of item variant) | 100 |
description | nullable string | description of Material | "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah." |
products/itemId | integer | id of Item of Product | 1 |
products/exemplaryItemVariantId | integer | id of Item variant of Product | 151 |
products/published | boolean | if you publish Product, turn this field true | true |
products/resizeMode | nullable string | resize mode of material | "contain" |
products/sub_materials/texture | string | url of texture image of material (data uri is OK) | "https://41.media.tumblr.com/QA9JpdgnOc8ov98s1C4S5EjJ_500.jpg" |
products/sub_materials/printSide | string | print side of SubMaterial | "back" |
products/sub_materials/enabled | boolean | if you enable SubMaterial, turn this field true | true |
$ curl -n -X POST /api/v1/materials \
-H "Content-Type: application/json" \
\
-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
}
]
}
]
}'
HTTP/1.1 200 OK
{
"material": {
"id": 31106,
"title": "AAスリスリくん",
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"price": 100,
"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",
"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/png/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,
"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
}
]
}
}
]
}
Update Material information
PUT /api/v1/materials/{material_id}
Name | Type | Description | Example |
---|---|---|---|
title | string | title of Material | "AAスリスリくん" |
price | integer | price of Material (will be added to the price of item variant) | 100 |
description | nullable string | description of Material | "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah." |
products/itemId | integer | id of Item of Product | 1 |
products/exemplaryItemVariantId | integer | id of Item variant of Product | 151 |
products/published | boolean | if you publish product, turn this field true | true |
products/resizeMode | nullable string | resize mode of material | "contain" |
$ curl -n -X PUT /api/v1/materials/$MATERIAL_ID \
-H "Content-Type: application/json" \
\
-d '{
"title": "AAスリスリくん",
"price": 100,
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"products": [
{
"itemId": 1,
"exemplaryItemVariantId": 151,
"published": true,
"resizeMode": "contain"
}
]
}'
HTTP/1.1 200 OK
{
"material": {
"id": 31106,
"title": "AAスリスリくん",
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"price": 100,
"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",
"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/png/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,
"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
}
]
}
}
]
}
Delete Material
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
レスポンスヘッダのみ返します
create Material & t-shirt by from text
POST /api/v1/materials/text
Name | Type | Description | Example |
---|---|---|---|
text | string | text which will made material | "AAスリスリくん" |
Name | Type | Description | Example |
---|---|---|---|
itemVariantId | integer | One product will be made from this item variant | 1 |
$ curl -n -X POST /api/v1/materials/text \
-H "Content-Type: application/json" \
\
-d '{
"text": "AAスリスリくん",
"itemVariantId": 1
}'
HTTP/1.1 200 OK
{
"material": {
"id": 31106,
"title": "AAスリスリくん",
"description": "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah.",
"price": 100,
"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",
"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/png/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,
"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
}
]
}
}
]
}
Product created from Material
Name | Type | Description | Example |
---|---|---|---|
id | integer | unique identifier of product | 1 |
title | string | title of product | "AAスリスリくん Tシャツ" |
published | boolean | if product is published, this is true | true |
publishedAt | nullable date-time | when product was published | "2015-01-14 11:58:29 +0900" |
createdAt | date-time | when product was created | "2015-01-14 11:58:29 +0900" |
updatedAt | date-time | when product was updated | "2015-01-14 11:58:29 +0900" |
examplaryAngle | nullable string | exemplary angle of products (which is used for SUZURI web page) | "back" |
imageUrl | string | url of product image (we have to fix where enclosed by \'{}\') | "https://d1q9av5b648rmv.cloudfront.net/{width}x{height}/t-shirt/{size}/{color}[/angle]/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b" |
sampleImageUrl | string | sample of image url | "https://d1q9av5b648rmv.cloudfront.net/1530x1530/t-shirt/s/white/31106/1399428195-2520x2992.png.jpg?h=224855199776d40aa2f7d6e3f181bfb19db9a90b" |
url | string | url of product (we have to fix where enclosed by \'{}\') | "https://suzuri.jp/surisurikun/31106/t-shirt/{size}/{white}" |
sampleUrl | string | sample of url | "https://suzuri.jp/surisurikun/31106/t-shirt/s/white" |
item:id | integer | unique identifier of Item | 1 |
item:name | string | unique name of Item | "t-shirt" |
item:angles | array | angles of Item (used when generate item image) | [1] |
item:humanizeName | string | descriptive label for Item, displayed on the screen | "Tシャツ" |
item:availablePrintPlaces | array | printable places | ["front","back"] |
item:defaultPrintPlace | string | print place which is selected as exemplary by default | "front" |
item:displayOrder | integer | sort order for displaying items list | 9 |
item:essentialAngles | array | angles that can be selected as the examplary angle | ["front","back"] |
item:extraAngles | array | angles that cannot be selected as the exemplary angle | ["front-wearing-mens","front-wearing-ladies"] |
item:iconUrls | object | URLs of item icon | {"png":"/assets/items/png/t-shirt.png"} |
item:isMultiPrintable | boolean | the item has two or more printable places or not | true |
item:printPlaceDisplayNames | object | descriptive names for each print places | {"front":"前面","back":"背面"} |
item:printPlaceForExtraAngles | object | {"t-shirt":{"front-wearing-mens":"front","front-wearing-ladies":"front"}} |
|
item:imageDescriptions | array | image descriptions on product page | ["","","男性モデル: 179cm","女性モデル: 163cm"] |
item:productImageUrlTemplates | object | URL templates of product image for each angles | {"front":"https://dp3obxrw75ln8.cloudfront.net/v3/{width}x{height}/t-shirt/{size}/{color}[/angle]/{filePath}[.{adjustment}].{ext}?h={hash}\u0026printed={printed}"} |
material:id | integer | unique identifier of Material | 31106 |
material:title | string | title of Material | "AAスリスリくん" |
material:description | nullable string | description of Material | "cjdiaosjdadfv:::surisurikun:::jaifiavdaiovfhaidhviwefoiah." |
material:price | integer | price of Material (will be added to the price of item variant) | 100 |
material:violation | boolean | true when the material go violate the rules | false |
material:published | boolean | true when the material go be published | true |
material:publishedAt | nullable date-time | when material was published | "2014-05-07 11:05:25 +0900" |
material:uploadedAt | date-time | when material was uploaded | "2014-05-07 11:03:15 +0900" |
material:dominantRgb | nullable string | dominant color RGB of material | "#ffffff" |
material:originalWidth | integer | original width of Material | 1920 |
material:originalHeight | integer | original height of Material | 1080 |
material:user:id | integer | unique identifier of User | 1 |
material:user:name | string | unique name of User | "surisurikun" |
material:user:displayName | nullable string | descriptive label for User, displayed on the screen | "忍者スリスリくん" |
material:user:avatarUrl | nullable string | url avatar image of User | "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488" |
sampleItemVariant:id | integer | unique identifier of item_variant | 1 |
sampleItemVariant:price | integer | price of item_variant | 2080 |
sampleItemVariant:exemplary | boolean | flag of exemplary or not (if variant was exemplary, that is used for SUZURI\'s products list page) | true |
sampleItemVariant:enabled | boolean | flag of enabled or not | true |
sampleItemVariant:isLightColor | boolean | flag of light color or not | true |
sampleItemVariant:isDarkColor | boolean | flag of dark color or not | true |
sampleItemVariant:color:id | integer | unique identifier of item color | 1 |
sampleItemVariant:color:name | string | unique name of item color | "white" |
sampleItemVariant:color:displayName | string | human readable name of item color | "ホワイト" |
sampleItemVariant:color:rgb | string | rgb color of item color | "#ffffff" |
sampleItemVariant:size:id | integer | unique identifier of item size | 1 |
sampleItemVariant:size:name | string | unique name of item size | "s" |
sampleItemVariant:size:displayName | string | human readable name of item size | "S" |
sampleItemVariant:printPlaces | array | [{"id"=>1, "place"=>"front", "price"=>500, "itemVariantId"=>2}] |
get Product list
GET /api/v1/products
Name | Type | Description | Example |
---|---|---|---|
itemId | string | name of Item pattern: [1-9][0-9]*$ | 1 |
limit | string | limit of Products list (default 20) pattern: [1-9]|[1-4][0-9]|50$ | 30 |
offset | string | offset of Products list pattern: [0-9][0-9]*$ | 100 |
userId | string | filtering list by User id of Product owner pattern: [1-9][0-9]*$ | 2 |
userName | string | filtering list by User name of Product owner pattern: [\w-]*$ | "surisurikun" |
materialId | string | filtering list by Material id pattern: [1-9][0-9]*$ | 101 |
$ curl -n -X GET /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",
"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/png/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,
"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
}
]
}
}
],
"meta": {
"hasNext": true
}
}
get Choice product list
GET /api/v1/choices/{choice_id}/products
Name | Type | Description | Example |
---|---|---|---|
limit | string | limit of Products list (default 20) pattern: [1-9]|[1-4][0-9]|50$ | 30 |
offset | string | offset of Products list pattern: [0-9][0-9]*$ | 100 |
$ curl -n -X GET /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",
"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/png/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,
"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
}
]
}
}
],
"meta": {
"hasNext": true
}
}
search Product
GET /api/v1/products/search
Name | Type | Description | Example |
---|---|---|---|
limit | string | limit of Products list (default 20) pattern: [1-9]|[1-4][0-9]|50$ | 30 |
offset | string | offset of Products list pattern: [0-9][0-9]*$ | 100 |
q | string | search word | "NINJYA" |
itemId | string | name of Item pattern: [1-9][0-9]*$ | 1 |
$ curl -n -X GET /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",
"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/png/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,
"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
}
]
}
}
],
"meta": {
"hasNext": true
}
}
get discounted product list
GET /api/v1/products/on_sale
Name | Type | Description | Example |
---|---|---|---|
limit | string | limit of Products list (default 20) pattern: [1-9]|[1-4][0-9]|50$ | 30 |
offset | string | offset of Products list pattern: [0-9][0-9]*$ | 100 |
$ curl -n -X GET /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",
"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/png/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,
"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
}
]
}
}
],
"meta": {
"hasNext": true
}
}
get info for a Product specified by id.
GET /api/v1/products/{product_id}
$ curl -n -X GET /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/png/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,
"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
}
]
}
],
"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
}
]
}
}
}
User is a Suzuri User.
Name | Type | Description | Example |
---|---|---|---|
id | integer | unique identifier of User | 1 |
name | string | unique name of User | "surisurikun" |
displayName | nullable string | descriptive label for User, displayed on the screen | "忍者スリスリくん" |
avatarUrl | nullable string | url avatar image of User | "https://dp3obxrw75ln8.cloudfront.net/users/avatars/7.png?1395818488" |
profile:url | nullable string | user\'s web page | "https://suzuri.jp/" |
profile:body | nullable string | profile description | "こんにちは!SUZURI の公式忍者・スリスリくんです。\\nキミも忍者にならないか?" |
profile:headerUrl | nullable string | url of header image of user\'s profile page | "https://dp3obxrw75ln8.cloudfront.net/profiles/headers/10.png?1398245916" |
identities | array | auth providers | [{"id"=>1, "provider"=>"twitter", "uid"=>1181557592, "nickname"=>"surisurikun", "url"=>"https://twitter.com/surisurikun"}] |
get User list
GET /api/v1/users
Name | Type | Description | Example |
---|---|---|---|
name | string | name of User pattern: [\w-]*$ | "surisurikun" |
limit | string | limit of User list (default 20) pattern: [1-9]|[1-4][0-9]|50$ | 30 |
offset | string | offset of User list pattern: [0-9][0-9]*$ | 100 |
$ curl -n -X GET /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"
}
]
}
],
"meta": {
"hasNext": true
}
}
Info for existing User.
GET /api/v1/users/{user_id}
$ curl -n -X GET /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"
}
]
}
}
Info for authorized User
GET /api/v1/user
$ curl -n -X GET /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"
}
]
}
}
update authorized 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"
}
]
}
}