Print data files

These endpoints allow you to create, read, update and delete print data files.

The types of print data files

In order to cover the entire processing and preflight of PDF print data, Keyline separates print data files into three categories:

  • Original files are such files that a client uploaded to a given location (could be a web-shop API, etc). After the upload the responsible software component can tell Keyline via the API that an upload occurred and have Keyline trigger further processing steps.
  • Processed files are such files that have been created by the print data PDF tools. This files can also be connected to a product's component (we recommend to always split print data files on a component-basis).
  • Imposed files are such files that are ready for print and already have the layout for a specific sheet that is attached to a print product in Keyline.

Attributes of a Print Data File object

id integer The ID of the print data file
product_id integer The ID of the associated product which owns this print data file
component_id integer The ID of the assoicated component this print data file refers to (when the file is of kind "processed")
sheet_id integer The ID of the assoicated sheet this print data file refers to (when the file is of kind "imposed")
uri string The full URI of this print data file, including the protocol
filesize integer The size of this print data file in bytes
kind string The kind of this print data file, one of "original", "processed", "imposed"
state string The state of this print data file, one of "newly_uploaded", "processing", "processed"
progress float The progress of the current processing, as percentage between 0 and 1
first_page integer The first page inside the print data file's PDF
last_page integer The last page inside the print data file's PDF
created_at datetime The date and time when the product was last modified
updated_at datetime The date and time when the product was last modified

Parameters

All of the below actions, expect the GET operations, expect a JSON document in the request body with the following attributes. Attributes that are marked as optional, can be omitted from the JSON document.

uri string The full URI, including the protocol under which the print data file can be retrieved. Note that this URI needs to be accessible to the Keyline user and all components involved in print data processing, but not to Keyline itself. Valid protocols are: http, https ftp, sftp, smb, and afp.
filesize integer The file size on disk of the print data file in bytes
state string The state of this print data file's processing. Since we want to give the user feedback about processing in the Keyline UI, the object should be created when processing starts and then continously updated (see also progress). Valid values are: newly_uploaded, processing, processed
kind string The kind of this print data file.
Use original if the file was uploaded by the user and not touched by processing.
Use processed when the file was created by the processing tools, in this case, Keyline expects the file's content to match a component, so a valid component_id must also be supplied.
Use imposed when this file contains the final imposed PDF data, in this case a sheet_id must be supplied, and a component_id cannot be supplied.
first_page integer The page number of the first page this print data file referes to
last_page integer The page number of the last page this print data file referes to
progress float The progress of processing to show in the Keyline UI. Must be a number between 0 and 1, should be continously updated during processing

Actions

Retrieve a List of all Print Data File objects

GET
/api/v1/products/{product_id}/print_data_files

Example request

$ curl -H "Authorization: Bearer 4b00c2cbffba2d16d24dd8adf0e843e6b143b54dbf800ce7ef12d431927ef63f" \
-H "Content-Type: application/json" \
https://api.keyline-mis.com/api/v1/products/8557/print_data_files

Retrieve a Print Data File object

GET
/api/v1/products/{product_id}/print_data_files/{print_data_file_id}

Example request

$ curl -H "Authorization: Bearer 4b00c2cbffba2d16d24dd8adf0e843e6b143b54dbf800ce7ef12d431927ef63f" \
-H "Content-Type: application/json" \
https://api.keyline-mis.com/api/v1/products/8557/print_data_files/1

Create a Print Data File object

POST
/api/v1/products/{product_id}/print_data_files

Example request

$ curl -X POST -H "Authorization: Bearer 4b00c2cbffba2d16d24dd8adf0e843e6b143b54dbf800ce7ef12d431927ef63f" \
-H "Content-Type: application/json" \
-d '{
      "print_data_file": {
        "filesize": "1234",
        "kind": "original",
        "state": "newly_uploaded",
        "uri": "smb://data_files/to_process/file1.pdf"
      }
    }'
https://api.keyline-mis.com/api/v1/products/8557/print_data_files

Update a Print Data File object

PATCH
/api/v1/products/{product_id}/print_data_files/{print_data_file_id}

Example request

$ curl -X PATCH -H "Authorization: Bearer 4b00c2cbffba2d16d24dd8adf0e843e6b143b54dbf800ce7ef12d431927ef63f" \
-H "Content-Type: application/json" \
-d '{
      "print_data_file": {
        "filesize": "12345678",
        "state": "processed",
      }
    }'
https://api.keyline-mis.com/api/v1/products/8557/print_data_files/1

Delete a Print Data File object

DELETE
/api/v1/products/{product_id}/print_data_files/{print_data_file_id}

Example request

$ curl -X DELETE -H "Authorization: Bearer 4b00c2cbffba2d16d24dd8adf0e843e6b143b54dbf800ce7ef12d431927ef63f" \
-H "Content-Type: application/json" \
https://api.keyline-mis.com/api/v1/products/8557/print_data_files/1