Operation
BETA: This functionality is under development and there may be changes not reflected in this help.
This section handles the fields usage.
GET fields/{id}/values
This method returns the list of fields values.
Request attribute:
- id [mandatory]: the Id of the field.
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- module [obligatorio]: indicates the module where is the field you want to get. 0: results, 1: autocontrol.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: returns the properties of the fields.
- message: "Success" or a descriptive information of the error in any other case.
Example:
Request: {"type":"get", "url":"fields/20210520092950AAC/values", "data":"company=edinn&session=0PY4RhPbK7YW5sbRXiwASrA2HEeCP0eGFzunnfiEJYWrp4whnU11FLESeYpB&mod=0"} Reponse (success): { "status": "0", "data": [ { "id": "20200423095359AAQDTRONCHO", "machdate": "HC0020200423095359", "id2": "20200421121153AAPDTRONCHO", "id_field": "20190507075910AAFDTRONCHO", "val": "", "id_author": "DAVID.TRONCHONI", "created": "20200423095359", "id_mod": "", "modified": "" }, { "id": "20200423095359AATDTRONCHO", "machdate": "HC0020200423095359", "id2": "20200421121153AAPDTRONCHO", "id_field": "20190507093159AANDTRONCHO", "val": "20200423140000", "id_author": "DAVID.TRONCHONI", "created": "20200423095359", "id_mod": "", "modified": "" } ], "message": "Success" } |
GET fields/values/gen
This method returns the list of fields values.
Request attribute:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- idproc [mandatory]: id of the process.
- module [obligatorio]: indicates the module where is the field you want to get. 0: results, 1: autocontrol.
- idfield1 [obligatorio]: id of the result or autocontrol.
- idfield2 [obligatorio]: id of the process, status, result relation.
- idfield3 [obligatorio]: id of the order, production registry or autocontrol.
- values [mandatory]: value to insert.
- parent [mandatory]: id of the field you want to assign the value.
- result: Id of the result (indicate only if there is a result change).
Response:
- status: returns "0" on success, and an error code in any other case.
- data: returns the properties of the fields.
- message: "Success" or a descriptive information of the error in any other case.
Example:
Request: {"type":"get", "url":"fields/values/gen", "data":"company=edinn&session=0PY4RhPbK7YW5sbRXiwASrA2HEeCP0eGFzunnfiEJYWrp4whnU11FLESeYpB&idfield1=20200411155128ACBCENTRAL&mod=0&idfield2=20200411155128ACBCENTRAL&parentid=20190507075910AAFDTRONCHO&values=testvalue&idproc=HC00"} Reponse (success): { "status": "0", "data": [ { "id": "20200423095359AAQDTRONCHO", "machdate": "HC0020200423095359", "id2": "20200421121153AAPDTRONCHO", "id_field": "20190507075910AAFDTRONCHO", "val": "", "id_author": "DAVID.TRONCHONI", "created": "20200423095359", "id_mod": "", "modified": "" }, { "id": "20200423095359AATDTRONCHO", "machdate": "HC0020200423095359", "id2": "20200421121153AAPDTRONCHO", "id_field": "20190507093159AANDTRONCHO", "val": "20200423140000", "id_author": "DAVID.TRONCHONI", "created": "20200423095359", "id_mod": "", "modified": "" } ], "message": "Success" } |
POST /fields/values
This method creates a new field values. The user must have the administrator role.
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- idproc [mandatory]: id of the process.
- module [obligatorio]: indicates the module where is the field you want to get. 0: results, 1: autocontrol.
- field [mandatory]: id of the result.
- value [mandatory]: value to insert.
- parent [mandatory]: id of the field you want to assign the value.
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.
Request: {"type":"post", "url":"fields/values/", "data":"company=edinn&session=0PY4RhPbK7YW5sbRXiwASrA2HEeCP0eGFzunnfiEJYWrp4whnU11FLESeYpB&idfield1=20200411155128ACBCENTRAL&mod=0&idfield2=20200411155128ACBCENTRAL&parentid=20190507075910AAFDTRONCHO&values=testvalue&idproc=HC00"} Reponse (success): { "status": "0", "data":true, "message": "Success" } |
DELETE /fields/{id}/values
This method deletes a configured fields value. The user must have the administrator role.
Request attribute:
- id [mandatory]: the Id of the field.
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- module [mandatory]: indicates the module where the field you want to delete is located. 0: results, 1: autocontrol.
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.
Request: {"type":"delete", "url":"fields/20210520092950AAC/values", "data":"company=edinn&session=0PY4RhPbK7YW5sbRXiwASrA2HEeCP0eGFzunnfiEJYWrp4whnU11FLESeYpB&mod=0"} Reponse (success): { "status": "0", "data":true, "message": "Success" } |