This documentation page is intended for developers looking to integrate the Dielines API into their systems. If you have any questions, please get in touch.
Die Cut Templates provides a hosted API available via HTTPS.
Dielines API allows for generating custom dielines in PDF, DXF, and SVG formats, along with 3D mockups.
To create custom dieline using the dieline template (becf-21e25) via the API, please make a
POST request to
https://api.diecuttemplates.com/dieline-templates/becf-21e25/dielines
curl -i -X POST \
https://api.diecuttemplates.com/dieline-templates/becf-21e25/dielines\
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_DIELINES_API_KEY_HERE>" \
-d '{
"format": "pdf",
"variables": {
"unit": "in",
"material": 1.1906,
"length": 8.0,
"width": 6.5,
"height": 3.5
}
}'
require 'uri'
require 'net/http'
require 'openssl'
url = URI('https://api.diecuttemplates.com/dieline-templates/becf-21e25/dielines')
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request['Content-Type'] = 'application/json'
request['Dielines-Api-Version'] = '1.0'
request['Authorization'] = 'Bearer <YOUR_DIELINES_API_KEY_HERE>'
params = {
"format": "pdf",
"variables": {
"unit": "in",
"material": 0.11,
"length": 4.25,
"width": 3.00,
"height": 5.00,
"top_tuck_flap": 0.53
}
}
request.body = params.to_json
response = http.request(request)
puts response.read_body
$url = 'https://api.diecuttemplates.com/dieline-templates/becf-21e25/dielines';
$data = [
"format" => "pdf",
"variables" => [
"unit" => "in",
"material" => "1.1906",
"length" => "8.0",
"width" => "6.5",
"height" => "3.5"
]
];
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'Authorization: Bearer <YOUR_DIELINES_API_KEY_HERE>'
]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
$response = curl_exec($ch);
if (curl_errno($ch)) {
echo 'Error: ' . curl_error($ch);
} else {
echo 'Response: ' . $response;
}
curl_close($ch);
application/json
{
"dieline": {
"type": "dieline",
"id": "ueipnpyp0rlw",
"dieline_template_id": "becf-10301",
"variables": {
"unit": "mm",
"length": 251.13,
"width": 102,
"height": 253,
"material": 2.22
},
"format": "pdf",
"url": "https://d2atdwxjx7uc4i.cloudfront.net/campaigns/0e9d742f-bdcd-4b41-8122-88e0426d263f20241218-14172-y29ocn.pdf",
"artwork_dimensions": {
"unit": "mm",
"width": "723.06",
"height": "502.44"
},
"created_at": "2024-12-18T19:27:22Z"
}
}
Variable name | dimension_type optional |
Description | |
Data type | string |
Default value | external |
Allowed values | external, internal |
Variable name | length required |
Description | length |
Data type | length |
Variable name | width required |
Description | width |
Data type | length |
Variable name | height required |
Description | height |
Data type | length |
Variable name | cover_height optional |
Description | cover height |
Data type | length |
Default value | 1.5748 in |
Variable name | direction optional |
Description | direction |
Data type | boolean |
Default value | false |
Allowed values | true, false, 0, 1 |
Variable name | cross optional |
Description | cross |
Data type | boolean |
Default value | false |
Allowed values | true, false, 0, 1 |
Variable name | lock_flap optional |
Description | lock flap |
Data type | length |
Default value | 1.2598 in |
Variable name | lock_length optional |
Description | lock length |
Data type | length |
Default value | 1.1206 in |
Variable name | peephole optional |
Description | peephole |
Data type | length |
Default value | 0.7874 in |
Variable name | hole_margin_1 optional |
Description | hole margin |
Data type | length |
Default value | 0.5906 in |
Variable name | hole_margin_2 optional |
Description | hole margin |
Data type | length |
Default value | 0.5906 in |
Variable name | arc_width optional |
Description | arc width |
Data type | length |
Default value | 0.315 in |
Variable name | lock_angle optional |
Description | lock angle |
Data type | angle |
Default value | 20 |
Allowed values | 15.0, 20.0, 25.0, 30.0, 35.0, 40.0, 45.0 |
Variable name | folding_margin optional |
Description | folding margin |
Data type | length |
Default value | 0.6299 in |
Variable name | lock_margin_1 optional |
Description | lock margin |
Data type | length |
Default value | 0.1969 in |
Variable name | lock_margin_2 optional |
Description | lock margin |
Data type | length |
Default value | 0.7874 in |
Variable name | glue_flap_1 optional |
Description | glue flap |
Data type | length |
Default value | 1.1811 in |
Variable name | glue_flap_2 optional |
Description | glue flap |
Data type | length |
Default value | 1.1811 in |
Variable name | dust_flap optional |
Description | dust flap |
Data type | length |
Default value | 1.9685 in |
Variable name | printing_method optional |
Description | Offset (material is squeezed) or Flexo (material is not squeezed) |
Data type | string |
Default value | offset |
Allowed values | offset, flexo |
Variable name | dimension_texts optional |
Description | |
Data type | boolean |
Default value | true |
Allowed values | true, false |