With the /workflow endpoint user can send a job to machine.

POST /api/Workflow/SendToMachine
Supports the following order types: 'laser-engraving-template', 'gravotech-rotary-engraving-template'
Model Request Example
api/Workflow/SendToMachine?job=jobName&printerDriver=printerDriverName
Response Example
If the operation is successful the response will be empty with status code 200
if there is any error, the response will have error messages with status code 409
POST /api/Workflow/SendToMachine

Supports the following order types: 'patch-order', 'embroidery-emblem-design', 'embroidery-emblem-template'
Model Request Example for nesting embroidery jobs and sending to machine
    {
        "MachineName": "Machine Name", // Machine name from machines configuration page
        "Jig": {
            "JigName": 'Emblem code from patch frame configuration page ',
            "JigOrders": 
                [{
                    "Quantity":27, // The quantity for the job to be nested
                    "Job": "J6LR8D33SPG", // Job Number
                    "RunsToGenerate":["7AF6CC1C","7AF6CC15"] // Run codes can be found in response when calling api/Workflow/EmbroideryNestingInfo. 
                                                             // If there is not any code, then the nesting process will create all files.
                                                             // If there is any code, then the nesting process will create embroidery files only matched to those run codes.
                }]
        }
    }
            
Response Example
If embroidery nesting validation is succesful the response will be the following with status code 200
{ "MachineName": 'The Machine Name from request', "JigName": 'Emblem code from request', "FrameType": 'The frame type to be used for embroidery nesting', // Possible values: Emblems, SmartNesting, ShapeNesting "Job": "J6LR8D33SPG" }
If there is any error, the response will have error messages with status code 409
POST /api/Workflow/SendDesignsToEmbroideryMachines

Model Request Example for Send Designs To Embroidery Machines
{
  "DesignNames": ["Design1","Design2"], // Can contain 1 or more design names.
  "MachineNames": ["MachineName1","MachineName2"], // Can contain 0 or more machine names. Not used when the 'Use Machine Mode' local setting is set as 'QR code'.
  "FacilityName": "Facility1", // This is mandatory, only when the company has facilities configured.
  "SendToPanel": false, // Only works for machines that support this feature.
  "TimeOutSeconds": 0 // Optional. Default = 120 Maximum = 120.
                      // 0 = Immediately returns an operation Id, which can be used in the api/Workflow/GetOperationProgress request.
                      // 1 - 120 = Waits up to this amount of seconds. If there is a result it returns it, otherwise returns an operation Id.
}
            
Response Example
This response contains only an operation Id, which can be used in the api/Workflow/GetOperationProgress request.
Status code: 202 - Accepted { "OperationId": "OperationProgress:SendDesignsToEmbMachines:ac03e7fd-2fc5-43fd-aa67-33745de83d95" }
This response indicates success for all designs on all machines.
Status code: 200 - Ok { "Status": "Success", "Progress": "Finished", "GeneralError": null, "ErrorDetails": [] }
This response indicates partial success. The ErrorDetails field contains an analysis of the errors.
Status code: 200 - Ok { "Status": "PartialSuccess", "Progress": "Finished", "GeneralError": null, "ErrorDetails": [ { "MachineName": "MachineName1", "DesignName": "Design1", "Error": { "ExceptionCode": 9200, "ExceptionMessage": "Timeout while waiting for a response from MachineLink" } }, ... ] }
This response indicates failure.This means either there is a general error that affects the whole operation, or all designs failed for all machines.
In the second case, the ErrorDetails field contains an analysis of the errors.
Status code: 200 - Ok { "Status": "Failed", "Progress": "Finished", "GeneralError": { "ExceptionCode": 9900, "ExceptionMessage": "No printer models provided." }, "ErrorDetails": [] }
POST /api/Workflow/EmbroideryNestingInfo

Supports the following order types: 'patch-order', 'embroidery-emblem-design', 'embroidery-emblem-template'
Model Request Example for nesting embroidery jobs and sending to machine
    {
        "MachineName": "Machine Name", // Machine name from machines configuration page
        "Jig": {
            "JigName": 'Emblem code from patch frame configuration page ',
            "JigOrders": 
                [{
                    "Quantity":27, // The quantity for the job to be nested
                    "Job": "J6LR8D33SPG" // Job Number
                }]
        }
    }
            
Response Example
If embroidery nesting validation is succesful the response will be the following with status code 200
{ "SplitFramePagesIntoMultipleFiles": true, //- true: means that the frame pages will be splitted into multiple files //- false: means that the frame pages will be splitted by adding a stop command in the same file "FrameWidth": 3.5429, //- It is the patch frame width as defined in patch frame configuration page // - For 'Emblems' it is calculated by (rows * VerticalSpacing) + (columns * HorizontalSpacing) // - For 'ShapeNesting' and 'SmartNesting' it is the frame width as this defined in nesting configuration profile that patch frame uses. "FrameHeight": 17.7165, //- The same as 'FrameWidth' "Openings": 5, // - It has value only when NestingType is 'Emblems' "NestingType": "Emblems", //- Possible values: 'Emblems', 'ShapeNesting', 'SmartNesting' "EmbroideryNestingPageInfos": [ { "Job": "ZLLM6ITU2OW", "PreviewBase64": "iVBORw0KGgoAAAANSUhEUgAAAQAAAAT8CAYAAABs....kSuQmCC", //- preview for nesting run "MachineHeads": 4, //- The number of machine heads that will be used for this run. "Quantity": 4, //- The quantity of emblems that will be produced for the specific run under each machine head (In this example total quantity is MachineHeads:4 x Quantity:4 = 16) "RunCode": "6E643BBB" //- This value can be used in api/Workflow/SendToMachine request to generate and send to machine only the specific run. } ] }
If there is any error, the response will have error messages with status code 409
POST /api/Workflow/SendToPrinter
Model Request Example for Kornit
{
  "ProductSku": "string",
  "OutputFilePath": "string",
  "PlatenName": "string",
  "Quantity": 0,
  "PrinterName": "string"
}
            
Model Request Example for Kornit when Job parameter is added
{
  "Quantity": 0,
  "PrinterName": "string",
  "PlatenName": "string",
  "Job": "JobName"
}
            
Model Request Example for Brother
{
  "ProductSku": "string",
  "OutputFilePath": "string",
  "PrinterName": "string"
}
            
Model Request Example for Brother when Job parameter is added
{
  "PrinterName": "string",
  "Job": "JobName"
}
            
Model Request Example for printers when submitting a Jig with orders
{
    "PrinterName": string,
    "Company": string,
    "NestingType": "string", (Optional) //- The value can be either "Jig" or empty "".
    "Jig": {
        "JigName": string,
        "JigFileName": string, (Optional),
        "BatchNumber": string,
        "BatchUrl": string,
        "BatchComments": string
        "JigOrders": [
            {
                "Job": string,
                "//TransformField": "Supported option is mirror",
                "Transform":string,
                "//MirrorTypeField": "Supported options are horizontal, vertical or both. Default is horizontal if the Transform is mirror.",
                "MirrorType":string,
                "//ScaleJob": "Supported options are true or false. Default is true.",
                "ScaleJob":bool
            }
        ]
    }
}
            
Model Request Example for printers when submitting a Nesting with orders
{
    "PrinterName": string,
    "Company": string,
    "NestingType": "string", (Required) //- Value must be "NestingProfile" when we want to nest jobs and send to printer, 
    "Nesting": {
        "NestingProfileName": "string", (Required) //- Nesting configuration profile name
        "BatchNumber": "string",
        "BatchUrl": "string",
        "BatchComments": "string",
        "Jobs": [
            "JMMN266BPC",
                ....

            "3XL1HZMLIG"
        ]
    }
  }
}

            
Response Example
Possible errors:
1036 - Output file does not exist
1504 - Printer is not configured
1505 - Printer profile is not configured
1506 - Platen is not configured
1507 - File Not Found
1026 - Invalid Job
5005 - Product SKU was not found
    
If the operation is successful the response will be empty with status code 200
if there is any error, the response will have error messages with status code 409
POST /api/Workflow/PrintWorksheet
Model Request Example
{
    "Company": "string",
    "PrinterName": "string",
    "BatchIdentifier": "string",
    "BatchWorksheetTemplate": "string",
    "Jobs": [{
            "Job": "string"
        }
    ]
}
            
Response Example
Possible errors:
1504 - Printer is not configured    
If the operation is successful the response will be empty with status code 200
if there is any error, the response will have error messages with status code 409
POST /api/Workflow/SendToEngraver
Model Request Example for engravers when submitting a Jig with orders
{
    "Company": string,
    "MachineName": string,
    "Jig": {
        "JigName": string,
        "JigFileName": string, (Optional)
        "BatchNumber": string, (Optional)
        "BatchUrl": string, (Optional)
        "BatchComments": string (Optional)
        "JigOrders": [
            {
                "Job": string,
                "//TransformField": "Supported option is mirror",
                "Transform":string,
                "//MirrorTypeField": "Supported options are horizontal, vertical or both. Default is horizontal if the Transform is mirror.",
                "MirrorType":string,
                "//ScaleJob": "Supported options are true or false. Default is true.",
                "ScaleJob":bool
            }
        ]
    }
}
            
Response Example
Possible errors:
1036 - Output file does not exist
1510 - Engraver is not configured
1507 - File Not Found
1026 - Invalid Job
5005 - Product SKU was not found
    
If the operation is successful the response will be empty with status code 200
if there is any error, the response will have error messages with status code 409
GET /api/Workflow/GetProductionFile Get the bytes of a production file for a job that has been generated successfully.
Request Example
/api/Workflow/GetProductionFile/?job=1234&filetype=PXF

Parameters:
job:
The string value of the job that was created.
- job is a required parameter.

filetype:
The file type that was saved on disk.
- Examples: 1234.PXF is for an Embroidery order so filtype will be PXF or 5678.PNG is for a Print order so filetype will be PNG.
- filetype is a required parameter.
                
Response Example
Response Example

"UE1MUFhGMDEUAAAAHJQBAIgAAAABDABDcmVhdGVkIEJ5OgAeAFRhamltYSBERzE2IGJ5IFB1bHNlIDc4 (continued ...) =="

A Base64 String of encoded bytes. This must be decoded. C# example: System.Convert.FromBase64String(bytes)

string fileName = "C:\\productionfiles\\somejob.pxf";
byte[] array = System.Convert.FromBase64String("UE1MUFhGMDEUAAAAHJQBAIgAAAABDABDcmVhdGVkIEJ5OgAeAFRhamltYSBERzE2IGJ5IFB1bHNlIDc4 (continued ...) ==");

using (var writer = new BinaryWriter(File.OpenWrite(fileName)))
{
    writer.Write(array);
}

If the operation is successful the response will have a status code 200 with the included bytes of the file.
If there are any exceptions, the response will have a status code 409 with the included error message.
                
GET /api/Workflow/GetOperationProgress
This endpoint returns the current progress of a previously started operation. You provide an operation ID that was returned when the operation was initiated. If the operation is still available, the API responds with its latest progress information. Operation progress is temporarily stored and remains available for up to 30 minutes after the operation starts.

Request Example
api/Workflow/GetOperationProgress?operationId=OperationProgress:SendDesignsToEmbMachines:dcbb6edd-9eee-4283-abec-ac03a1c1a93d
             
Response
Status code: 200 OK – The operation was found and its current progress is returned. The model returned depends on the operation. 
Status code: 404 Not Found – No operation exists with the provided ID (it may be invalid or expired).
Status code: 409 Conflict – An unexpected error occurred while retrieving the operation status.