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-10620) via the API, please make a
POST request to
https://api.diecuttemplates.com/dieline-templates/becf-10620/dielines
curl -i -X POST \
https://api.diecuttemplates.com/dieline-templates/becf-10620/dielines\
-H "Content-Type: application/json" \
-H "Authorization: Bearer <YOUR_DIELINES_API_KEY_HERE>" \
-d '{
"format": "pdf",
"variables": {
"unit": "in",
"material": 0.4826,
"length": "8.0",
"width": "2.0",
"height": "6.0",
"top_separator_height": "1.0",
"top_slot_length": "1.575",
"top_slot_width": "0.985",
"bottom_separator_height": "1.0",
"bottom_hole": "1.0",
"top_1st_radius": "0.2",
"top_2nd_radius": "0.2",
"top_3rd_radius": "0.2",
"top_4th_radius": "0.2"
}
}'
require 'uri'
require 'net/http'
require 'openssl'
url = URI('https://api.diecuttemplates.com/dieline-templates/becf-10620/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-10620/dielines';
$data = [
"format" => "pdf",
"variables" => [
"unit" => "in",
"material" => "0.4826",
"length" => "8.0",
"width" => "2.0",
"height" => "6.0",
"top_separator_height" => "1.0",
"top_slot_length" => "1.575",
"top_slot_width" => "0.985",
"bottom_separator_height" => "1.0",
"bottom_hole" => "1.0",
"top_1st_radius" => "0.2",
"top_2nd_radius" => "0.2",
"top_3rd_radius" => "0.2",
"top_4th_radius" => "0.2"
]
];
$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 | 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 | top_separator_height required |
Description | top separator height |
Data type | length |
Variable name | top_slot_length required |
Description | top slot length |
Data type | length |
Variable name | top_slot_width required |
Description | top slot width |
Data type | length |
Variable name | bottom_separator_height required |
Description | bottom separator height |
Data type | length |
Variable name | bottom_hole required |
Description | bottom hole |
Data type | length |
Variable name | cross optional |
Description | cross |
Data type | boolean |
Default value | false |
Allowed values | true, false, 0, 1 |
Variable name | direction optional |
Description | direction |
Data type | boolean |
Default value | false |
Allowed values | true, false, 0, 1 |
Variable name | separator_thumb_cut_1 optional |
Description | separator thumb cut |
Data type | boolean |
Default value | false |
Allowed values | true, false, 0, 1 |
Variable name | separator_thumb_cut_2 optional |
Description | separator thumb cut |
Data type | length |
Default value | 0.0 in |
Variable name | top_1st_radius required |
Description | top 1st radius |
Data type | length |
Variable name | top_2nd_radius required |
Description | top 2nd radius |
Data type | length |
Variable name | top_3rd_radius required |
Description | top 3rd radius |
Data type | length |
Variable name | top_4th_radius required |
Description | top 4th radius |
Data type | length |
Variable name | top_dust_flap optional |
Description | top dust flap |
Data type | length |
Default value | 1.2715 in |
Variable name | top_tuck_flap optional |
Description | top tuck flap |
Data type | length |
Default value | 0.6 in |
Variable name | bottom_dust_flap_1 optional |
Description | bottom dust flap |
Data type | length |
Default value | 1.2715 in |
Variable name | bottom_dust_flap_2 optional |
Description | bottom dust flap |
Data type | length |
Default value | 0.6 in |
Variable name | glue_flap optional |
Description | glue flap |
Data type | length |
Default value | 0.5 in |