Operation
This section handles the results operation.
GET /results
This method returns a list of results. You have to provide a specific process and the stant and end time in order to filter the results. The user must have the results role.
Request parameters:
- company [mandatory]: The company name or id.
- session [mandatory]: The Id of the active session.
- process [mandatory]: The Id of the process of which you want the results.
- dateFrom [mandatory]: The starting date of the selection.
- dateTo [mandatory]: The ending date of the selection.
Response:
- Returns the list of the results in json format.
Example:
Request:
/results
{
"session": LzRlv4vjbyHWPhO2B2ulNjmSZFNmvpW4aqbLaoz1n6KJF91RJPCsZcmVLzpy
"company": DEMO04
“Process”: A0L1
“Datefrom”: 20181010000000
“Dateto”: 20191110000000
}
Response:
{
"status": 0,
Data: {
"Id": "20181115173804AABINIT",
"MachDate": "A0L120181115173804",
"PN": "",
"id_prod": "8561",
"QA": "1",
"QB": "0",
"QC": "0",
"QT": "100%",
"Id_Author": "MIGUEL",
"Created": "20181115173804",
"Id_Mod": "",
"Modified": "",
"Link": "",
"Paused": "0",
"Id_Paused": "",
"Id_Sync": "",
"ProdType": "0",
"Desc": "8561 1.4L"
"message":" Success"
}
POST /results
Allows you the possibility of adding a new result. The user must have the results role.
Request:
- company [mandatory]: The company name or id.
- session [mandatory]: The Id of the active session.
- process [mandatory]: The Id of the process.
- result [mandatory]: The Id of the result.
- date: The date on which you want to insert the result. Uses current date and time by default.
- order: The Id of the order.
- quantityA: quantity for the 1st variable.
- quantityB: quantity for the 1st variable.
- quantityC: quantity for the 1st variable.
- device: The Id of the device.
Response:
- Returns TRUE if the result has been successfully inserted.
Example:
Request:
/results
{
"session": LzRlv4vjbyHWPhO2B2ulNjmSZFNmvpW4aqbLaoz1n6KJF91RJPCsZcmVLzpy
"company": DEMO04
“Process”: A0L1
"result": 123456
}
Response:
{
"status": 0,
"data": true,
"message": "Success"
}
DELETE /results/{id}
This method deletes a results. The user must have the administrator or supervisor role.
Request attribute:
- id [mandatory]: the Id of the status.
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: "true" on success, and empty in case of error.
- message: "success" or a descriptive information of the error in any other case.
Example:
Request:
/results/123456
{
"session": 01qgmfcZmZ4nqg2eNGpxY4JlpmhJuKw1H31p5rtD1a112SSK8S8odROFIKgn
"company": DEMO04
}
Response:
{
"status": 0,
"data": true,
"message": "Success"
}
GET /results/summary
This method returns a list of results. You have to provide a specific process and the start and end time in order to filter the results.
Request parameters:
- company [mandatory]: The company name or id.
- session [mandatory]: The Id of the active session.
- process [mandatory]: The Id of the process of which you want the results.
- area [mandatory]: The Id of the area.
- dateFrom [mandatory]: The starting date of the selection.
- dateTo [mandatory]: The ending date of the selection.
- showio: Shows the inputs and outputs of the selection.
- type: The index of result type.
- type = 0: Production
- type = 1: Scrap
- type = 2: Rework
Response:
- status: returns "0" on success, and an error code in any other case.
- data: returns the amount of results produced grouped by result and filtered by the criteria in the request, on success or the link to the request help on error.
- message: "Success" or a descriptive information of the error in any other case.
Example:
Request: {"type":"get", "url":"results/summary", "data":"company=testco&session=1FrqhchVXQoAgpxUbdKHWQkILZjMMAV0cesiSMmaRjwFvaWLwrpLyxJ6O9Zo&area=7200&process=7202&dateFrom=20200910060000&dateTo=20200910140000&showio=0"} Reponse (success): {"status":"0", "data":[{"Area":"7200-NAVE2","Process":"7202-RS 7202","Result":"A01-Botella100mlCiclopiroxOlamineGerda*","Type":"Results","Quantity":"718852","Units":"MI","ActualKg":"718852","Target":"89.85","TargetKg":"89.85","ProductionOrder":"","Team":""},{"Area":"","Process":"","Result":"","Type":"TOTALES","Quantity":"718852","Units":"MI","ActualKg":"718852","Target":"89.85","TargetKg":"89.85","ProductionOrder":"","Team":""}], "message":"Success"} Reponse (error): {"status":"1012", "data":"<a href='http:\/\/127.0.0.1:8080\/edinnM2\/help\/en\/API_.html'>for additional information follow this link<\/a>", "message":"Process not found"} |