Dielines API for Developers

You can offer the same service on your own website by using our Dielines API. We help with integration and charge a flat fee for access to our generator.

How It Works?

We provide a simple API that lets you browse dielines and their parameters, get previews of given dielines exactly as on our site and finally request vector versions of dielines you need. You get EPS files immediately and then forward them to your customers for free or for a fee. Simple!

Show Me The Code

Sure, the code is below. There are three types of methods in the API:

  1. Getting dielines and collections lists;
  2. Getting parameters of a given dieline and its preview;
  3. Requesting the EPS file of a given dieline with parameters.

Below we provide the methods you can use and expected responses of our generator. In most cases you make a simple GET request and receive a JSON reply from the server.

Getting dielines

You can query the list of dieline categories this way:

https://dielines.boxshot.com/collections

The response is the array of collection names:

[ "ECMA", "FEFCO" ]

Then you can query the dielines of a given collection:

https://dielines.boxshot.com/collections/FEFCO/dielines

The response is the array of dictionaries, where each dictionary represents a dieline:

[
    {
        "id" : "fefco-0200",
        "name" : "0200",
        "description" : "Half Slotted Container"
    },
    {
        "id" : "fefco-0201",
        "name" : "0201",
        "description" : "Regular Slotted Container"
    },
    ...
]

Or you can get all the dielines at once using this query:

https://dielines.boxshot.com/dielines

The response is pretty much the same, only "collection" field is added:

[
    {
        "id" : "fefco-0200",
        "name" : "0200",
        "description" : "Half Slotted Container",
        "collection" : "FEFCO"
    },
    {
        "id" : "fefco-0201",
        "name" : "0201",
        "description" : "Regular Slotted Container",
        "collection" : "FEFCO"
    },
    ...
]

Once you got a dieline identifier you can query its parameters.

Getting parameters

Each dieline has the list of parameters that you can see at the left when use our dieline editor. You can get this list by providing the dieline id using this query:

https://dielines.boxshot.com/dielines/{id}/vars2

For instance, for FEFCO-0300 the query is:

https://dielines.boxshot.com/dielines/fefco-0300/vars2

The response is the array of dictionaries, where each dictionary represents a variable:

[
    {
        "name" : "Height",
        "type" : "length",
        "value" : 269.291,
        "min" : 50,
        "max" : 10000
    },
    {
        "name" : "Part",
        "type" : "option",
        "value" : 0,
        "options" : ["Bottom","Top"]
    },
    {
        "name" : "Double Lock",
        "type" : "bool",
        "value" : false
    },
    ...
]

Each variable has "name" and "type" parameters. Name is displayed to the user, type is used to parse the rest of the dictionary. There are three types of variables:

  • length - floating point parameter, defining the length in points. The dictionary also contains "min" and "max" parameters, defining the range of the variable, and "value" parameter - the default value of the variable;
  • option - this is a "combo-box" parameter, letting the user to select one option from a given list. The dictionary contains "options" array with strings for each option that can be selected. The "value" parameter defines the default selection index;
  • bool - this a "check-box" parameter, letting the user to configure "yes or no" property. There are no additional parameters in the dictionary and the "value" parameter is either "true" or "false".

You get the list of variables and present them to the user the way you need. You may also want to convert units to inches or millimeters and back. Once the user configured the properties, you can query a preview of the dieline with those properties:

https://dielines.boxshot.com/dielines/{id}/preview?....params....

Where "id" is the dieline identifier and "...params..." is a GET-like query with all the variables and their values. Here are some real-world examples:

https://dielines.boxshot.com/dielines/fefco-0427/preview?Length=600&Width=400&Height=170&Paper%20Thickness=2.8&Double%20Lock=true
https://dielines.boxshot.com/dielines/fefco-0300/preview?Length=600&Width=400&Height=170&Paper%20Thickness=2.8&Top%20Part%20Offset=0&Part=Bottom

Here's what you need to send back for variables of supported types:

  • length - floating point number in points;
  • option - the string from the "options" list that the user selected;
  • bool - "true" or "false" depending on the user selection.

The generator returns a PNG preview of the specified dieline that you show to the user.

Requesting the EPS file

Once the parameters are configured and preview looks good, you can request the EPS file by sending a POST request to:

https://dielines.boxshot.com/partner-eps

The request should contain the form-encoded parameters:

  • code - the secret API key you get from us;
  • layout - the dieline id, as above (like "fefco-0200");
  • params - the GET-like query string as you passed to preview generation request.

If the code is correct, you will get the EPS file back.

Questions?

What is the price?

The price is $99 (USD) a month paid upfront for a year. This gives $1188 that you pay and get the secret key to access the EPS generation API.

Any API usage limits?

We do not limit the layout, variables and preview API calls, yet the fair usage policy still applies.

The number of EPS generations should not exceed 1000 per day. Let us know if you plan to generate more dielines, as we'll need to provide extra capacity for you. Note that this will affect the price mentioned above.

Any other limitations?

The EPS generation API uses secret key which needs to be kept private. This means the EPS geneation API call should not be done on the client side, as this way the secret key becomes public. We block such keys and it takes time to get the new one, so calling EPS generation API from server is a good idea.

The rest of the API can be called from the client side.

How to get the secret code?

This is simple: contact us, make the payment, get the code. Your 12 months start when you get the code, so it might be a good idea to implement the "free" part of the API first to make sure it works the way you need, then get the secret key from us and start using the service immediately.

Anything else?

No, contact us when you are ready to order the key. Simple :)