Create Files

Route to create a new file resource. File resources will get attached to jobs in order detail using file reason codes to identify the purpose of the file in production steps.
Paths for a file resource could either be a full URL to the file resource or a FTP path, including the username and password.

An optional pre-flighting service is available for all POSTed files. File POST can include a “preflight” parameter set to “true” to trigger 4over’s pre-flighting engine to pre-flight the file and return appropriate response(s).
Pre-flight requests could include product size, bleed and safe data in the request which will notify the service to respond with more details to allow the user to create their own safe and bleed lines on the preview images.

If no “preflight” flag is set or the flag value is set to ‘false’, file is uploaded without pre-flighting.

Here is a list of possible pre-flighting messages and message-codes:

Key : Value

“101”:”Fonts Issue”
“101”:”Font is not embedded”
“102”:”Images below 250 dpi”
“103”:”Object uses RGB”
“104”:”Pantone colors used”
“105”:”Some objects are set to overprint”
“106”:”Page is empty”
“107”:”2 pages PDF”
“107”:”Multipage PDF”
“108”:”Transparency used (filled object with ca value smaller than 1.0)”
“108”:”Transparency used (blend mode not “Normal” nor “Compatible”)”
“108”:”Transparency used (transparency group)”
“108”:”Transparency used (soft mask in image)”
“109”:”Image ink coverage above 390%”
“501”:”Unable to download file for processing”
“502”:”File is encrypted and cannot be processed”
“110”:”Font not embedded {specific font}”
“500”: Generic error code that means “An Internal Error Occured” or “Could Not Process File”

Resource URI

POST /files                                                  

Input Parameters

@param path {string} Path to resource file (http, https or ftp paths)
@param preflight {boolean} (optional) set to "true"
@param width {decimal} width of the order posted
@param height {decimal} height of the order posted
@param bleed {decimal} bleed size of the order posted (Optional)
@param safe {decimal} safe area of the order posted (Optional)

POST Files Without Preflight:

JSON

{
  "path": ["ftp://username:password@server/filepath"]
}

OR

JSON

{
  "path":["http://url.com/file/path/filename.pdf"]
}

Sample Response – Without Preflight

JSON

{
  "files":[
    {
      "file_uuid":"37b68f92-7fac-4585-933f-852582d961eb",
      "extention":"pdf",
      "reference_file_name":"sample_front_preflight.pdf",
      "uri":"http://api.4over.com/files/37b68f92-7fac-4585-933f-852582d961eb"
    }
  ]
}

POST With Preflight Request (Not Including Box Data):

JSON

{
    "path": [         
          "http://xyz.your_url.com/final_front.png",
          "http://xyz.your_url.com/final_back.png"
    ],
    "preflight": true
}

Sample Response – With Preflight Request (Not Including Box Data):

JSON

{
  "files":[
    {
      "status":"warning",
      "pdf_uuid":"7c8fe4a3-c82f-47c6-9d85-cf54170854f3",
      "pdf_uri":"http:\/\/api.4over.com\/files\/7c8fe4a3-c82f-47c6-9d85-cf54170854f3",
      "customer_filename":"final_front.png",
      "customer_file":"http:\/\/api.4over.com\/files\/dcb4b584-2286-4ac2-a1e9-1f18daf0299b",
      "preview_uuid":"addc7346-7382-4786-9b48-6c90f091de0c",
      "preview_uri":"http:\/\/api.4over.com\/files\/addc7346-7382-4786-9b48-6c90f091de0c",
      "message":{
        "102":"Images below 250 dpi",
        "103":"Object uses RGB",
        "108":"Transparency used (soft mask in image)"
      }
    },
    {
      "status":"fail",
      "message":{
        "501":"Unable to download file for processing"
      }
    }
  ]
}

POST with pre-flight request (Including Box Data):

JSON

{
    "path": [         
          "http://xyz.your_url.com/final_front.png",
          "http://xyz.your_url.com/final_back.png"
    ],
    "preflight": true,
    "width": 3.5,       
    "height": 2,         
    "bleed":0.125,    
    "safe”:0.125      
}

Sample Response – With Pre-Flight request (Including Box Data):

JSON

{
  "files":[
    {
      "box_dimensions":{
        "bleedbox":{
        "width":"680",
        "height":"398.62068965517"
        },
        "safebox":{
        "width":"633.10344827586",
        "height":"351.72413793103"
        },
        "trimbox":{
        "width":"656.55172413793",
        "height":"375.1724137931"
        },
        "preview_imagebox":{
        "width":"948.35249042146",
        "height":"1563.2183908046"
        }
      },
      "status":"warning",
      "pdf_uuid":"e0707684-b6f1-4eff-a132-a0a4f75d023f",
      "pdf_uri":"http:\/\/api.4over.com\/files\/e0707684-b6f1-4eff-a132-a0a4f75d023f",
      "customer_filename":"final_front.png",
      "customer_file":"http:\/\/api.4over.com\/files\/dcb4b584-2286-4ac2-a1e9-1f18daf0299b",
      "preview_uuid":"375e509a-5de0-4ace-90fb-9595fd7d9489",
      "preview_uri":"http:\/\/api.4over.com\/files\/375e509a-5de0-4ace-90fb-9595fd7d9489",
      "message":{
      "102":"Images below 250 dpi",
      "107":"Multipage PDF"
      }
    },
    {
      "box_dimensions":{
        "bleedbox":{
          "width":"680",
          "height":"398.62068965517"
          },
          "safebox":{
          "width":"633.10344827586",
          "height":"351.72413793103"
          },
          "trimbox":{
          "width":"656.55172413793",
          "height":"375.1724137931"
          },
          "preview_imagebox":{
          "width":"948.35249042146",
          "height":"1563.2183908046"
          }
        },
        "status":"success",
        "pdf_uuid":"b81c8e11-e8d3-4ee4-85d1-d47e9c969130",
        "pdf_uri":"http:\/\/api.4over.com\/files\/b81c8e11-e8d3-4ee4-85d1-d47e9c969130",
        "customer_filename":"final_back.png",
        "customer_file":"http:\/\/api.4over.com\/files\/dcb4b584-2286-4ac2-a1e9-1f18daf0299b",
        "preview_uuid":"6133323f-a548-4bcc-b431-ad8d609d5f35",
        "preview_uri":"http:\/\/api.4over.com\/files\/6133323f-a548-4bcc-b431-ad8d609d5f35"
      }
    }  
  ]
}  

POSTs With Box Dimension Data and Failed Preflight

JSON

{
  "files":[
    {
      "box_dimensions":{
        "bleedbox":{
          "width":"680",
          "height":"398.62068965517"
        },
        "safebox":{
          "width":"633.10344827586",
          "height":"351.72413793103"
        },
        "trimbox":{
          "width":"656.55172413793",
          "height":"375.1724137931"
        },
        "preview_imagebox":{
          "width":"0",
          "height":"0"
        }
      },
      "status":"Fail",
      "message":{
        "501":"Unable to download file for processing"
      }
    }
  ]
}