With the /PretreatmentCodes endpoint user can manage pretreatment codes from the database.
GET
/api/PretreatmentCodes/List
Get a list of all pretreatment codes
Request Example
/api/PretreatmentCodes/List
RESPONSE EXAMPLE
[
{
"Id": "string",
"Name": "string",
"Nozzles": "string",
"SprayStart": "string",
"SprayStop": "string",
"CarriageSpeed": "string",
"MetricUnit": "string",
"DoubleSpray": "string",
"TableSetting": "string",
"BarcodeText": "string"
},
{...}
]
GET
/api/PretreatmentCodes/Get
Get a pretreatment code
Request Example
/api/PretreatmentCodes/Get?id=pretreatmentCodeId&name=pretreatmentCodeName
Use id parameter to get pretreatment code by id or
Use name parameter to get pretreatment code by name
RESPONSE EXAMPLE
If found, a pretreatment code is returned with status code 200. Otherwise an error with code and message is returned with status code 404
{
"Id": "string",
"Name": "string",
"Nozzles": "string",
"SprayStart": "string",
"SprayStop": "string",
"CarriageSpeed": "string",
"MetricUnit": "string",
"DoubleSpray": "string",
"TableSetting": "string",
"BarcodeText": "string"
}
POST
/api/PretreatmentCodes/Create
Create a pretreatment code
Model Request Example
{
"CarriageSpeed": "string",
"DoubleSpray": "string",
"MetricUnit": "string",
"Name": "string",
"Nozzles": "string",
"SprayStart": "string",
"SprayStop": "string",
"TableSetting": "string"
}
Response Example
If the operation is successful a pretreatment code will be returned with status code 201
Otherwise an error with code and message will be returned with status code 409
PUT
/api/PretreatmentCodes/Update
Update a pretreatment code
Request Example
/api/PretreatmentCodes/Update?id=pretreatmentCodeId&name=pretreatmentCodeName
Use id parameter to identify the pretreatment code to update by id or
Use name parameter to identify the pretreatment code to update by name
Model Request Example
All fields are updated
{
"CarriageSpeed": "string",
"DoubleSpray": "string",
"MetricUnit": "string",
"Name": "string",
"Nozzles": "string",
"SprayStart": "string",
"SprayStop": "string",
"TableSetting": "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/PretreatmentCodes/Delete
Delete a pretreatment code
Request Example
/api/PretreatmentCodes/Delete?id=pretreatmentCodeId&name=pretreatmentCodeName
Use id parameter to identify the pretreatment code to update by id or
Use name parameter to identify the pretreatment code 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