Operation
This section handles the statuses operation.
GET /statuses
Provides you a list of statuses. You have to provide a specific process and the start and end time in order to filter the statuses. The user must have the statuses role.
Request:
- session [mandatory]: Your session Id.
- company [mandatory]: The Id of the company.
- process [mandatory]: The Id of the process of which you want the statuses.
- datefrom [mandatory]: The starting date of the selection.
- dateto [mandatory]: The ending date of the selection.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: "Success" on success, and empty in case of error.
- id: Record identifier in the database.
- machdate: Indicates the process where the status was registered along with the start date and time of the period in the format yyyymmddhhmmss.
- id_tu: Status code.
- endtime: End date and time of the period in the format yyyymmddhhmmss. This field remains blank for the current status.
- secs: Duration of the period in seconds. It remains at 0 for the current status.
- id_author: Identifier of the resource that created the period. The value CENTRAL indicates that it was automatically created by Edinn.
- created: Indicates the creation date and time of the record in the database in the format yyyymmddhhmmss.
- id_mod: If the record was modified, it indicates the identifier of the resource that last modified it.
- modified: Indicates the date and time of the last modification of the record in the database in the format yyyymmddhhmmss.
- link: Identifier of the comment table record associated with this status record.
- notified: Date and time when an email notification was sent about this status in the format yyyymmddhhmmss.
- tu_desc: Status description in the language of the resource that made the request.
- tu_type: Type of status. The status types are described here.
- message: "Success" or a descriptive information of the error in any other case.
Example:
Request: {"type":"get", "url":"statuses", "data":"company=testco&session=LzRlv4vjbyHWPhO2B2ulNjmSZFNmvpW4aqbLaoz1n6KJF91RJPCsZcmVLzpy&process=7101&datefrom=20211008060000&dateto=20211008090000"} Response (success): {"status":"0", "data":[{"id":"20211008093900AARCENTRAL","machdate":"710120211008060000","id_tu":"SNP","endtime":"20211008085530","secs":"10530","id_author":"CENTRAL","created":"20211008093900","id_mod":"ADMIN","modified":"20211008101419","link":"","notified":"","tu_desc":"SIN PRODUCCION","tu_type":"4"},{"id":"20211008101419AAGINIT","machdate":"710120211008085530","id_tu":"6105","endtime":"20211008095512","secs":"3582","id_author":"ADMIN","created":"20211008101419","id_mod":"ADMIN","modified":"20211008101432","link":"","notified":"","tu_desc":"Cambio de pedido o modelo","tu_type":"1"}], "message":"Success"} |
POST /statuses
Create a new status. You have to provide a specific process and the start and end time in order to filter the statuses. The user must have the statuses role.
Request:
- company [mandatory]: The Id of the company.
- session [mandatory]: Your session Id.
- process [mandatory]: The Id of the process of which you want the statuses.
- device [mandatory]: The Id of the device that the status pertains to.
- status [mandatory]: The name of the new status.
- datefrom [mandatory]: The date of the new status.
- dateend: If the status is planned, indicates the finish date of it.
- calendar: Indicates if the status is planned or not.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: status identifier code on success, and empty in case of error.
- message: "Success" or a descriptive information of the error in any other case.
Example:
Request: {"type":"post", "url":"statuses", "data":"company=testco&session=0bvqC8zNdyTkm5BrqX7M0C80IC3O2MraAz0RxKyhnenmNfNVTL0aH5dpMJO6&process=7102&datefrom20211011160000&dateto=20211011163000&status=6105&calendar=1&device=init"} Response (success): {"status":"0","data":"20211011153821AABINIT","message":"Success"} |
DELETE /statuses/{id}
This method deletes a status. View this document to know the restrictions that apply.
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: "success" on success, and empty in case of error.
- message: "success" or a descriptive information of the error in any other case.
Example:
Request: {"type":"delete", "url":"statuses/20211011153821AABINIT", "data":"company=testco&session=0bvqC8zNdyTkm5BrqX7M0C80IC3O2MraAz0RxKyhnenmNfNVTL0aH5dpMJO6&calendar=1"} Response (success): {"status":"0","data":true,"message":"Success"} |
DELETE /statuses
This method deletes a status. View this document to know the restrictions that apply.
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- datefrom [mandatory]: the start date of the period
- dateto [mandatory]: the finish date of the period.
- calendar [mandatory]: Indicates if the status is planned or not.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: "success" on success, and empty in case of error.
- message: "success" or a descriptive information of the error in any other case.
Example:
Request: {"type":"delete", "url":"statuses", "data":"company=testco&session=0bvqC8zNdyTkm5BrqX7M0C80IC3O2MraAz0RxKyhnenmNfNVTL0aH5dpMJO6&process=7102&datefrom=20211011160000&dateto=20211011163000&calendar=1"} Response (success): {"status":"0","data":true,"message":"Success"} |
PATCH /statuses/{id}
This method justifies a status.
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.
- date [mandatory]: The starting date of the selection.
- status [mandatory]: the id of the status to justify.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: "success" on success, and empty in case of error.
- message: "success" or a descriptive information of the error in any other case.
Example:
Request: {"type":"patch", "url":"statuses/20211011141555ACSCENTRAL", "data":"company=testco&session=0bvqC8zNdyTkm5BrqX7M0C80IC3O2MraAz0RxKyhnenmNfNVTL0aH5dpMJO6&date=20211011141500&status=6104"} Response (success): {"status":"0","data":true,"message":"Success"} |
PUT /statuses/{id}
This method justifies or divides a status based on the type of the parameter passed. (0 to Justify, 1 to Divide)
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.
- type[mandatory]: Type of PUT operation (0 to Justify, 1 to Divide.)
- status: the id of the status to justify. (mandatory in order to Justify a status).
- date: The starting date of the selection (mandatory in order to Divide a status).
- device: The Id of the device (mandatory in order to Divide a status).
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 (Divide):
Request: {"type":"put", "url":"statuses/20090301070004TBBCENTRAL", "data":"company=testco&session=0bvqC8zNdyTkm5BrqX7M0C80IC3O2MraAz0RxKyhnenmNfNVTL0aH5dpMJO6&date20211011134506=FAI&type=1&device=init"} Response (success): {"status":"0","data":true,"message":"Success"} |
Example (Justify):
Request: {"type":"put", "url":"statuses/20090301070004TBBCENTRAL", "data":"company=testco&session=0bvqC8zNdyTkm5BrqX7M0C80IC3O2MraAz0RxKyhnenmNfNVTL0aH5dpMJO6&status=FAI&type=0"} Response (success): {"status":"0","data":true,"message":"Success"} |
GET /statuses/fai
This method returns information related to the failure(s) of a process.
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- process [mandatory]: the id of the process
Response:
- status: returns "0" on success, "01" in the case of there being no failures, and an error code in any other case.
- data: Returns the data pertaining to the failures of the selected process, or in the case of no failures, a link to help info.
- message: "success" or a descriptive information of the error in any other case.
Example:
Request: {"type":"get", "url":"statuses/fai", "data":"company=testco&session=0bvqC8zNdyTkm5BrqX7M0C80IC3O2MraAz0RxKyhnenmNfNVTL0aH5dpMJO6&process=7102"} Response (success): {"status":"0","data":[{"id":"20211011134701AAKCENTRAL","machdate":"710220211011060000","id_tu":"FAI","end":"","secs":"0","Author":"CENTRAL","Created":"20211011134701","Modifier":"","Modified":"","Link":"3","Notified":"","type":"PENDING"},{"id":"20211011134659AAICENTRAL","machdate":"710220211011134500","id_tu":"6531","end":"","secs":"0","Author":"CENTRAL","Created":"20211011134659","Modifier":"","Modified":"","Link":"4","Notified":"","type":"Final turno ma\u00f1ana"}],"message":"Success"} |
GET /statuses/summary
Provides you a list of statuses. You have to provide a specific process and the stant and end time in order to filter the statuses.
Request:
- session [mandatory]: Your session Id.
- company [mandatory]: The Id of the company.
- process [mandatory]: The Id of the process of which you want the statuses.
- datefrom [mandatory]: The starting date of the selection.
- dateto [mandatory]: The ending date of the selection.
- top: The maximum number of statuses shown. Default value is 10.
- Type: The type of status.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: "Success" on success, and empty in case of error.
- message: "Success" or a descriptive information of the error in any other case.
Example:
Request: {"type":"get", "url":"statuses/summary", "data":"company=testco&session=0bvqC8zNdyTkm5BrqX7M0C80IC3O2MraAz0RxKyhnenmNfNVTL0aH5dpMJO6&process=7101&datefrom=20211008060000&dateto=20211009060000&top=3"} Response (success): {"status":"0","data":[{"id":"6102","start":"","time":"51375","quantity":"1","desc_de":"Cambio de bobina","desc_en":"Cambio de bobina","desc_es":"Cambio de bobina","desc_it":"Cambio de bobina","desc_pt":"Cambio de bobina","desc_sk":"","desc_zh":""},{"id":"0","start":"","time":"12759","quantity":"4","desc_de":"PRODUCCION","desc_en":"PRODUCCION","desc_es":"PRODUCCION","desc_it":"PRODUCCION","desc_pt":"PRODUCCION","desc_sk":"","desc_zh":""},{"id":"SNP","start":"","time":"11094","quantity":"2","desc_de":"SIN PRODUCCION","desc_en":"SIN PRODUCCION","desc_es":"SIN PRODUCCION","desc_it":"SIN PRODUCCION","desc_pt":"SIN PRODUCCION","desc_sk":"","desc_zh":""}],"message":"Success"} |
GET /statuses/top
This method returns the Id and description of the top status of the selected process.
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- Process [mandatory]: the id of the process
Response:
- status: returns "0" on success, and an error code in any other case.
- data: Id and description of the status
- message: "success" or a descriptive information of the error in any other case.
Example:
Request: {"type":"get", "url":"statuses/top", "data":"company=testco&session=0bvqC8zNdyTkm5BrqX7M0C80IC3O2MraAz0RxKyhnenmNfNVTL0aH5dpMJO6&process=7101"} Response (success): {"status":"0", "data":[{"Id":"6105","Desc":"Cambio de pedido o modelo"},{"Id":"6102","Desc":"Cambio de bobina"},{"Id":"6301","Desc":"Limpieza"}], "message":"Success"} |