RESOURCE | Nesting Templates

GET '/dielines/{dieline_id}/nesting-templates'

Retrieve a nesting template list for a specific dieline. Returns nesting templates filtered based on the dieline's formula options (dimensions, material, etc.), ensuring only applicable templates are returned for that specific dieline configuration.

Request Parameters

dieline_id string Unique identifier for the "dieline" object required
Example: "di_fwe4iu3vngty"

Response Object

Returns a "nesting_templates_list" object.

Objects | nesting_template_list

Represents a list of nesting (also known as imposition or layout) templates available for a specific dieline. The list is filtered based on the dieline's variables (dimensions, material, etc.) to show only applicable templates.

type string "nesting_template_list"
id string Unique identifier for the nesting_template_list
Example: "ntl_12345678"
dieline_id string Unique identifier for the dieline.
Example: "di_fwe4iu3vngty"
dieline_template_id string Unique identifier for the dieline template that this dieline is based on.
Example: "becf-10301"
total integer Total number of nesting templates in the list.
Example: 42
nesting_template_components [nesting_template_component] An array of "nesting_template_components" in the list. Each template in the nesting_template_list may satisfy one or many "nesting_template_components". For example, a nesting template may satisfy "Hard cardboard of the box", or "Hard cardboard of the cover" or both.
nesting_templates [nesting_templates] An array of "nesting_templates" in the list. Each template includes links for available actions such as creating a nesting.


Code Examples


curl -i -X GET \
https://api.diecuttemplates.com/dielines/di_fwe4iu3vngty/nesting-templates \
  -H 'Authorization: Bearer <YOUR_DIELINES_API_KEY_HERE>' \
  -H 'Dielines-Api-Version: 1.0'

require 'uri'
require 'net/http'
require 'openssl'

url = URI('https://api.diecuttemplates.com/dielines/di_fwe4iu3vngty/nesting-templates')

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request['Dielines-Api-Version'] = '1.0'
request['Authorization'] = 'Bearer <YOUR_DIELINES_API_KEY_HERE>'

response = http.request(request)
puts response.read_body

$url = 'https://api.diecuttemplates.com/dielines/di_fwe4iu3vngty/nesting-templates';

$ch = curl_init($url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Dielines-Api-Version: 1.0',
    'Authorization: Bearer <YOUR_DIELINES_API_KEY_HERE>'
]);

$response = curl_exec($ch);

if (curl_errno($ch)) {
    echo 'Error: ' . curl_error($ch);
} else {
    echo 'Response: ' . $response;
}

curl_close($ch);

Example Response, Status = 200

application/json
{
  "nesting_template_list": {
    "type": "nesting_template_list",
    "id": "ntl_kw4Z80qKP6",
    "dieline_id": "di_aretrmecuekx",
    "dieline_template_id": "becf-30203",
    "total": 2,
    "nesting_template_components": [],
    "nesting_templates": [
      {
        "type": "nesting_template",
        "id": "lt_NJYkRajK70",
        "nesting_template_components": [
          {
            "type": "nesting_template_component",
            "id": "hard-cardboard-of-the-box",
            "name": "Hard cardboard of the box",
            "category": "hard_cardboard"
          }
        ],
        "variables": [
          {
            "type": "dieline_template_variable",
            "name": "sheet_dimensions",
            "description": "Sheet dimensions including sheet_width, sheet_height, margin_top, margin_bottom and margin_side",
            "data_type": "sheet_dimensions",
            "required": true,
            "children": []
          },
          {
            "type": "dieline_template_variable",
            "name": "num_x",
            "description": "Number of dielines on the x axis.",
            "data_type": "integer",
            "required": false,
            "children": []
          },
          {
            "type": "dieline_template_variable",
            "name": "num_y",
            "description": "Number of dielines on the y axis",
            "data_type": "integer",
            "required": false,
            "children": []
          },
          {
            "type": "dieline_template_variable",
            "name": "margin_x",
            "description": "Horizontal spacing ",
            "data_type": "length",
            "required": false,
            "default_value": {
              "value": "0.0",
              "unit": "mm"
            },
            "children": []
          },
          {
            "type": "dieline_template_variable",
            "name": "margin_y",
            "description": "Vertical spacing",
            "data_type": "length",
            "required": false,
            "default_value": {
              "value": "0.0",
              "unit": "mm"
            },
            "children": []
          }
        ],
        "images": [
          {
            "type": "svg",
            "url": null
          }
        ],
        "links": [
          {
            "rel": "create_nesting",
            "href": "/dielines/di_aretrmecuekx/nestings/lt_NJYkRajK70",
            "method": "POST"
          }
        ]
      },
      {
        "type": "nesting_template",
        "id": "lt_2lY22jOYP6",
        "nesting_template_components": [
          {
            "type": "nesting_template_component",
            "id": "hard-cardboard-of-the-box",
            "name": "Hard cardboard of the box",
            "category": "hard_cardboard"
          }
        ],
        "variables": [
          {
            "type": "dieline_template_variable",
            "name": "sheet_dimensions",
            "description": "Sheet dimensions including sheet_width, sheet_height, margin_top, margin_bottom and margin_side",
            "data_type": "sheet_dimensions",
            "required": true,
            "children": []
          },
          {
            "type": "dieline_template_variable",
            "name": "num_x",
            "description": "Number of dielines on the x axis.",
            "data_type": "integer",
            "required": false,
            "children": []
          },
          {
            "type": "dieline_template_variable",
            "name": "num_y",
            "description": "Number of dielines on the y axis",
            "data_type": "integer",
            "required": false,
            "children": []
          },
          {
            "type": "dieline_template_variable",
            "name": "margin_x",
            "description": "Horizontal spacing ",
            "data_type": "length",
            "required": false,
            "default_value": {
              "value": "0.0",
              "unit": "mm"
            },
            "children": []
          },
          {
            "type": "dieline_template_variable",
            "name": "margin_y",
            "description": "Vertical spacing",
            "data_type": "length",
            "required": false,
            "default_value": {
              "value": "0.0",
              "unit": "mm"
            },
            "children": []
          }
        ],
        "images": [
          {
            "type": "svg",
            "url": null
          }
        ],
        "links": [
          {
            "rel": "create_nesting",
            "href": "/dielines/di_aretrmecuekx/nestings/lt_2lY22jOYP6",
            "method": "POST"
          }
        ]
      }
    ]
  }
}