With the /Printers endpoint user can manage Printers from the database.
GET
/api/Printers/List
Get a list of all Printers
Request Example
/api/Printers/List
RESPONSE EXAMPLE
[
{
"Id": "string",
"Name": "string",
"Prefix": "string",
"MaxWidth": Number,
"MaxHeight": Number,
"PrinterType": "string",
"Dpi": Number,
"PaperWidth": Number,
"PaperHeight": Number,
"FolderPath": "string",
"OutputFormat": "string",
"PrinterColors": [
{
"Id": "string",
"PrinterId": "string",
"Color": "string", //format : rgb(x,x,x)
"ReplaceableColor": "string", //format : rgb(x,x,x)
},
{...}
]
},
{...}
]
GET
/api/Printers/Get
Get a printer
Request Example
/api/Printers/Get?id=printerId&name=printerName
Use id parameter to get printer by id or
Use name parameter to get printer by name
RESPONSE EXAMPLE
If found, a printer is returned with status code 200. Otherwise an error with code and message is returned with status code 404
{
"Id": "string",
"Name": "string",
"Prefix": "string",
"MaxWidth": Number,
"MaxHeight": Number,
"PrinterType": "string",
"Dpi": Number,
"PaperWidth": Number,
"PaperHeight": Number,
"FolderPath": "string",
"OutputFormat": "string",
"PrinterColors": [
{
"Id": "string",
"PrinterId": "string",
"Color": "string", //format : rgb(x,x,x)
"ReplaceableColor": "string", //format : rgb(x,x,x)
},
{...}
]
}
POST
/api/Printers/Create
Create a printer
Model Request Example
{
"Name": "string",
"Prefix": "string",
"MaxWidth": Number,
"MaxHeight": Number,
"PrinterType": "string",
"Dpi": Number,
"PaperWidth": Number,
"PaperHeight": Number,
"FolderPath": "string",
"OutputFormat": "string",
"PrinterColors": [
{
"Color": "string", //format : rgb(x,x,x)
"ReplaceableColor": "string", //format : rgb(x,x,x)
},
{...}
]
}
Response Example
If the operation is successful a printer will be returned with status code 201
Otherwise an error with code and message will be returned with status code 409
PUT
/api/Printers/Update
Update a printer
Request Example
/api/Printers/Update?id=printerId&name=printerName
Use id parameter to identify the printer to update by id or
Use name parameter to identify the printer to update by name
Model Request Example
All fields are updated
{
"Name": "string",
"Prefix": "string",
"MaxWidth": Number,
"MaxHeight": Number,
"PrinterType": "string",
"Dpi": Number,
"PaperWidth": Number,
"PaperHeight": Number,
"FolderPath": "string",
"OutputFormat": "string",
"PrinterColors": [
{
"Color": "string", //format : rgb(x,x,x)
"ReplaceableColor": "string", //format : rgb(x,x,x)
},
{...}
]
}
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/Printers/Delete
Delete a printer
Request Example
/api/Printers/Delete?id=printerId&name=printerName
Use id parameter to identify the printer to update by id or
Use name parameter to identify the printer 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