Image APIs
This API allows you to make an HTTP request to get an image of a dieline.
Get a dieline image
- URL:
/v1/reseller/image
- Method:
GET
- Header:
Authorization
. To make a valid request you need to be authenticated using access token. For more info see authentication - URL Params:
- article: the box type you want to generate, e.g. s020_v1. For more info see articles
- material: the type of material used to print the box, e.g. SBS300. For more info see materials
- article_width: the width of the box e.g. 65 in millimeters. The width must be a numeric value with max precision set to two decimal places
- article_depth: the depth of the box e.g. 65 in millimeters. The depth must be a numeric value with max precision set to two decimal places
- article_height: the height of the box e.g. 75 in millimeters. The height must be a numeric value with max precision set to two decimal places
- image_type: the extension of the produced image, pass a string value between jpeg, png or webp.
- image_width: the width of the resulting image in pixels, e.g. 800.
- image_height: the height of the resulting image in pixels, e.g. 600.
- Data params none
- Response: a stream of the requested file
Errors
The errors raised by this endpoint can be of the following types:
- VALIDATION_ERROR
- IMG_1100: article is required and must be a valid article code
- IMG_1101: material is required and must be a valid material code
- IMG_1102: article_width is required and must be a positive number with no more than two decimal places
- IMG_1103: article_depth is required and must be a positive number with no more than two decimal places
- IMG_1104: article_height is required and must be a positive number with no more than two decimal places
- IMG_1105: image_type is required
- IMG_1106: image_width is required and must be a positive integer number
- IMG_1107: image_height is required and must be a positive integer number
- BOX_ERROR
- for this type of errors, please refer to the errors page
- INTERNAL_SERVER_ERROR
- for this type of errors, please refer to the errors page
- NOT_FOUND
- for this type of errors, please refer to the errors page
Examples
Request
GET /v1/reseller/image HTTP/1.1
Authorization: Bearer eHZ6MWV2R ... o4OERSZHlPZw==
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
article=s001_v0
material=SBS300
article_width=80
article_depth=80
article_height=120
image_type=jpeg
image_width=800
image_height=600
Response
A stream of the requested file.