Dieline APIs
This API allows you to make an HTTP request to obtain a dieline PDF.
Get a dieline PDF
- URL:
/v1/reseller/dieline
- 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
- 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
- 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
- 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
- type: the type of response, pdf to obtain a stream or json to obtain a json response which contains a base64 encoded PDF string.
- Data params: none
- Response: a PDF stream or a content type application/json response made by the following fields:
- request: an object that contains all data you used on your HTTP request and containing the following fields:
- uri: the URI you used to make the HTTP request
- method: the HTTP method, e.g. GET
- query: an object containing all the parameters and the related values you used to make the HTTP request
- response: an object that contains the following fields:
- buffer: a base64 encoded string of the dieline PDF
- mime_type: mime type of the file
- encoding: file encoding
- request: an object that contains all data you used on your HTTP request and containing the following fields:
Errors
The errors raised by this endpoint can be of the following types:
- VALIDATION_ERROR
- DLN_1100: article is required and must be a valid article code
- DLN_1101: material is required and must be a valid material code
- DLN_1102: width is required and must be a positive number with no more than two decimal places
- DLN_1103: depth is required and must be a positive number with no more than two decimal places
- DLN_1104: height is required and must be a positive number with no more than two decimal places
- DLN_1105: type is required
- 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/dieline HTTP/1.1
Authorization: Bearer eHZ6MWV2R ... o4OERSZHlPZw==
Content-Type: application/x-www-form-urlencoded;charset=UTF-8
box=s001_v0
material=SBS300
width=80
depth=60
height=120
type=json
Response
HTTP status code: 200
{
"request": {
"uri": "v1/reseller/dieline",
"method": "GET",
"query": {
"article": "s001_v0",
"material": "SBS300",
"width": 80,
"depth": 60,
"height": 120,
"type": "json"
}
},
"response": {
"buffer": "JVBERi0x...Y5CiUlRU9GCg==",
"mime_type": "application/pdf",
"encoding": "base64"
}
}