With the /Machines endpoint user can get the machine infomraiont from database.

GET /api/Machines/List Get a list of machines.
Request Example
    /api/Machines/List?facility=Facility1&category=MachineCategory1
    facility and category parameters are optional
            
Response Example
    [
        ...
        {
            "Id": "string",
            "Name": "string",
            "MacAddress": "string",
	        "Type": "string",
	        "Number": "string",
            "IsUseDefaultNeedles": false,
            "CategoryName": "Uncategorized",
            "Description": "string",
            "PossibleStitches": null,
            "PossiblePieces": null,
            "NumberOfHeads": null,
            "Active": true,
            "Alias": "string",
            "Needles": [
                {
                    "Needle": 1,
                    "ColourId": "string",
                    "ColourName": "string",
                    "DisplayNeedle": "string",
                    "Code": "string",
                    "Name": "string",
                    "Manufacturer": "string",
                    "Red": 0,
                    "Green": 0,
                    "Blue": 0
                },
	        ...
            ],
            "DefaultNeedles": [
                {
                    "Needle": 1,
                    "ColourId": "string",
                    "ColourName": "string",
                    "DisplayNeedle": "string",
                    "Code": "string",
                    "Name": "string",
                    "Manufacturer": "string",
                    "Red": 0,
                    "Green": 0,
                    "Blue": 0
                },
            ...
            ],
	        "Shifts": [
                {
                    "Id": "string",
                    "ShiftId": "string",
                    "NumOfStitches": 0,
                    "NumOfPieces": 0
                },
            ...
            ],
	        "SetupTime": 5.0,
	        "AppliqueStop": null,
	        "RPM": null,
	        "ColourChangeTime": 4.0,
	        "TrimTime": 2.0,
            "ShouldColourize": true,
            "IP": "string",
	        "Firmware": "string",
	        "ConnectionType": 1,
	        "IsSerial": false,
	        "ActualMachineName": "string",
	        "AutoSendToQueue": false,
	        "TruncateLength": null,
	        "SetNeedles": false,
	        "MaxNeedleNumber": null,
	        "IsColoreel": false,
	        "ColoreelApiUrl": "string",
	        "ColoreelApiSecret": "string",
	        "ColoreelUsername": "string",
            "DisplayName": "string",
            "IsSync": true,
	        "MachineDisplayName": "string",
	        "FacilityId": "string",
            "Facility": {
		        "FacilityName": "string",
		        "CompanyId": "string",
		        "Id": "string"
	        },
            "UseDefaultEmblemSettings": false,
	        "SplitFramePagesIntoMultipleFiles": false,
	        "AddRepeatsToTCFFile": false,
	        "FrameWidth": 0.0,
	        "FrameHeight": 0.0,
	        "LicenseType": 0,
	        "LicenseTypeString": "Not-Subscribed",
	        "ConnectionStatus": 0
        },
        ...
    ]
            
GET /api/Machines/GetMachineNeedles Get a list of machines needles.
Request Example
    /api/Machines/GetMachineNeedles?id=machineId
                
Response Example
    [
        {
            "NeedleNumber": 0,
            "ColorId": "string",
            "ColorName": "string",
            "ColorCode": "string",
            "ColorRed": 0,
            "ColorGreen": 0,
            "ColorBlue": 0
        }
    ]
            
GET /api/Machines/GetDefaultNeedles Get a list of default machine needles.
Request Example
    /api/Machines/GetDefaultNeedles
            
Response Example
    [
        {
            "NeedleNumber": 0,
            "ColorId": "string",
            "ColorName": "string",
            "ColorCode": "string",
            "ColorRed": 0,
            "ColorGreen": 0,
            "ColorBlue": 0
        }
    ]
            
GET /api/Machines/GetMachineStatus/{id} Returns the information of current operator details
Request Example
    /api/Machines/GetMachineStatus/?id=0
            
Response Example
{
	"MachineId": 0,
	"Pieces": 0,
	"PiecesNumStitches": 0,
	"UpdatedDate": "3/27/2019 10:13:37 AM",
	"Machine": "string",
	"CurrentDesign": "string",
	"Status": "string",
	"StopReason": "string",
	"Operator": "string",
	"OperatorId": 0,
	"OperatorSName": "string",
	"OperatorMail": "string",
	"OperatorPhone": "string",
	"OperatorCannedMessages": "string",
}
            
POST /api/Machines/UpdateMachineNeedles
Model Request Example
ColorId is optional. Pass "0" (or null/empty) to unassign the colour from the machine needle; needles not included in the request are left unchanged.

[
	{
	    "MachineId": "string",
	    "NeedleNumber": 1,
	    "ColorId": "string"
	}
]
            
Response Example
Response will be 200 OK if there is no error otherwise response will be 409 conflict with error message
            
POST /api/Machines/UpdateDefaultNeedles
Model Request Example
ColorId is optional. Pass "0" (or null/empty) to unassign the colour from the default needle.

[
	{
	    "NeedleNumber": 1,
	    "ColorId": "string"
	}
]
            
Response Example
Response will be 200 OK if there is no error otherwise response will be 409 conflict with error message
            
GET /api/Machines/MoveOutputToMachineFolder Moves job files to machine folder
Request Example
    /api/Machines/MoveOutputToMachineFolder?machineName=mymachine&jobName=myJob
            
Response Example
   Response will be 200 OK if there is no error otherwise response will be 409 conflict with error message
            
GET /api/Machines/Get Get a machine
Request Example
    /api/Machines/Get?id=machineId&name=machineName
            Use id parameter to get machine by id or
            Use name parameter to get machine by name
            
RESPONSE EXAMPLE
    If found, a machine is returned with status code 200. Otherwise an error with code and message is returned with status code 404  
    {
        "Id": "string",
        "Name": "string",
        "IsUseDefaultNeedles": true/false,
        "CategoryName": "string",
        "Description": "string",
        "PossibleStitches": Number,
        "PossiblePieces": Number,
        "NumberOfHeads": Number,
        "Active": true/false,
        "Alias": "string",
        "Needles": [
            {
                "Needle": 1,
                "ColourId": "2c674c22-964f-4050-82f5-b86e648b5cb5",
                "ColourName": "1078 - Paprika",
            },
            { ... }
        ],
        "Shifts": [
            {
                "Id": "string",
                "ShiftId": "string",
                "StitchesPerShift": Number,
                "PiecesPerShift": Number,
            
            }
        ],
        "SetupTime": Number,
        "RPM": Number,
        "ColourChangeTime": Number,
        "TrimTime": Number,
        "ShouldColourize": true,
        "IsSerial": true/false,
        "ActualMachineName": "11",
        "AutoSendToQueue": true,
        "TruncateLength": Number,
        "SetNeedles": true/false,
        "MaxNeedleNumber": Number,
        "IsColoreel": true/false,
        "ColoreelApiUrl": "string",
        "ColoreelApiSecret": "string",
        "ColoreelUsername": "string"
    }    
            
POST /api/Machines/Create
Model Request Example
    {
        "Name": "string",
        "IsUseDefaultNeedles": true/false,
        "CategoryName": "string",
        "Description": "string",
        "PossibleStitches": Number,
        "PossiblePieces": Number,
        "NumberOfHeads": Number,
        "Active": true/false,
        "Alias": "string",
        "Needles": [
            {
                "Needle": 1,
                "ColourId": "2c674c22-964f-4050-82f5-b86e648b5cb5",
                "ColourName": "1078 - Paprika",
            },
            { ... }
        ],
        "Shifts": [
            {
                "ShiftId": "string",
                "StitchesPerShift": Number,
                "PiecesPerShift": Number,

            }
        ],
        "SetupTime": Number,
        "RPM": Number,
        "ColourChangeTime": Number,
        "TrimTime": Number,
        "ShouldColourize": true,
        "IsSerial": true/false,
        "ActualMachineName": "11",
        "AutoSendToQueue": true,
        "TruncateLength": Number,
        "SetNeedles": true/false,
        "MaxNeedleNumber": Number,
        "IsColoreel": true/false,
        "ColoreelApiUrl": "string",
        "ColoreelApiSecret": "string",
        "ColoreelUsername": "string"
    }    
            
Response Example
If the operation is successful a machine will be returned with status code 201
Otherwise an error with code and message will be returned with status code 409          
            
PUT /api/Machines/Update Update a machine
Request Example
    /api/Machines/Update?id=machineId&name=machineName
            Use id parameter to identify the machine to update by id or
            Use name parameter to identify the machine to update by name
            
Model Request Example
    All fields are updated
    {
        "Name": "string",
        "IsUseDefaultNeedles": true/false,
        "CategoryName": "string",
        "Description": "string",
        "PossibleStitches": Number,
        "PossiblePieces": Number,
        "NumberOfHeads": Number,
        "Active": true/false,
        "Alias": "string",
        "Needles": [
            {
                "Needle": 1,
                "ColourId": "2c674c22-964f-4050-82f5-b86e648b5cb5",
                "ColourName": "1078 - Paprika",
            },
            { ... }
        ],
        "Shifts": [
            {
                "ShiftId": "string",
                "StitchesPerShift": Number,
                "PiecesPerShift": Number,

            }
        ],
        "SetupTime": Number,
        "RPM": Number,
        "ColourChangeTime": Number,
        "TrimTime": Number,
        "ShouldColourize": true,
        "IsSerial": true/false,
        "ActualMachineName": "11",
        "AutoSendToQueue": true,
        "TruncateLength": Number,
        "SetNeedles": true/false,
        "MaxNeedleNumber": Number,
        "IsColoreel": true/false,
        "ColoreelApiUrl": "string",
        "ColoreelApiSecret": "string",
        "ColoreelUsername": "string"
    }    
            
Response Example
If the operation is successful an empty response will be returned with status code 200
Otherwise an error with code and message will be returned with status code 409
            
DELETE /api/Machines/Delete Delete a machine
Request Example
/api/Machines/Delete?id=machineId&name=machineName
Use id parameter to identify the machine to update by id or
Use name parameter to identify the machine to delete by name
            
Response Example
If the operation is successful an empty response will be returned with status code 200
Otherwise an error with code and message will be returned with status code 409