Configuration
BETA: This functionality is under development and there may be changes not reflected in this help.
This section handles the fields configuration.
GET fields/{id}/config
This method returns the list of fields.
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 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:
Content-Type: application/json Request: /fields/config?company=edinn&session=0PY4RhPbK7YW5sbRXiwASrA2HEeCP0eGFzunnfiEJYWrp4whnU11FLESeYpB&mod=0&idfield=S0000 Reponse (success): { "status": "0", "data": [ { "id": "20210520092950AAC", "id2": "S0000", "var": "1a2s1", "desc": "testApi2", "values": "1a2s", "ftype": "0", "mandat": "0", "id_comb": "", "io": "0", "id_calc": "", "fclass": "0", "maxlength": "255", "calculated": "0", "locked": "0", "inherits": "0", "stock": "0" }, ], "message": "Success" } |
POST /fields/config
This method creates a new field. The user must have the administrator role.
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- parent [mandatory]: the Id of the result or autocontrol.
- variable [mandatory]: internal name of the field. Allows to carry out statistical studies, links with algorithms (types of calculation), etc. You can change the description (field) field, but not the variable name.
- description [mandatory]: literally that appears to the working user.
- values [mandatory]: default value or the possible answers that the user could give (separated by commas).
- module [mandatory]: indicates the module where you want to store the field. 0: results, 1: autocontrol.
- type:
0: Real, number with decimals.
1: Integer, number without decimals.
2: Date, date in the dd/mm/yyyy format.
3: Time, time in the hh:mm format.
4: Text, free text.
5: IP Address, IP network address.
6: Time Secs, time in hh:mm:ss format
7: Selection, allows to make a drop-down menu. Use the combos configuration window to configure options.
8: URL, url upon the system syntax. Please see how to configure URLs.
9: Alphabetic, only letters.
10: Date and time, dd/mm/yyyy hh:mm format.
11: Date and time (secs.), dd/mm/yyyy hh:mm:ss format.
12: Mult. Selection, multiple selection.
13: MAC, MAC address.
14: Percentage, number for percentages.
15: Autoincrement, unique numeric value for the field independent of the result or task to which it is associated.
16: Button, calls a function declared in a field management UDL.
17: TCP port, TCP port between 1 and 65535
18: Now date, current date in dd/mm/yyyy format.
19: Now time, current time in hh:mm format.
20: Now time (secs.), current time in hh:mm:ss format.
21: Now date and time, current date and time in dd/mm/yyyy hh:mm format.
22: Now date and time (secs.), current date and time in dd/mm/yyyy hh:mm:ss format.
23: E-mail, Email address.
- domain: if you selected the optins 7 or 12, then you shouuld specify the id of the combo.
- apply: indicates to what this field should be apply (Production, Inputs, Outputs, I&O [Inputs and Outputs], etc.).
- mandatory: when the field is mandatory. The options are the following:
- When configuring fields for results:
- 0: only if empty.
- 1: the field is always mandatory.
- 2: the field is never mandatory.
- 3: when results are being inserted manually.
- 4: when finishing or pausing a order. This option will only apply for fields on inputs.
- 5: when starting an order.
- When configuring fields for autocontrol:
- 0: never is mandatory.
- 1: when the status of the task changes.
- 2: if the task status is changed to Ok.
- 3: if the task status is changed to warning.
- 4: if the task status is changed to error.
- 5: if the task status is changed to error or warning.
- 6: when the task is started.
- calculation: calculation type to be applied to the field. This is useful to convert the values of the fields.
- fclass: this is to indicate to other computer systems the type of the field. Please see integration with other systems.
- 0: General purpose field class.
- 1: Unit of measure. If informed, prevails over the unit of measure of the process.
- 2: Cycle time. Is informed, prevails over the one of the process and the PSR relation.
- 3: Cycle quantity or cycle units. Is informed, prevails over the one of the process and the PSR relation.
- 4: inform about the material lot.
- 5: stores the corresponding B2MML tag.
- 6: stores the corresponding B2MML tag.
- 7: stores the corresponding B2MML tag.
- 8: stores the corresponding B2MML tag.
- 9: stores the corresponding B2MML tag.
- 10: stores the corresponding B2MML tag.
- 11: stores the corresponding B2MML tag.
- 12: stores the corresponding B2MML tag.
- 13: stores the corresponding B2MML tag.
- 14: stores the corresponding B2MML tag.
- 15: stores the corresponding B2MML tag.
- 16: stores the corresponding B2MML tag.
- 17: stores the corresponding B2MML tag.
- 18: stores the corresponding B2MML tag.
- 19: every production counting is equivalent to how many pieces. For example: 1 unit (a box) is equivalent to 6 pieces.
- 20: visual conversion from production units to visual units.
- maxlength: maximum length of the field.
- calculated: indicates if the field will be calculated by a UDL.
- locked: indicates if the field cannot be changed by the user.
- inherits: indicates if the field inherits its value from the field with the same variable name of the previous production record.
- stock: indicates if the field is used to diferentiate stock.
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.
Content-Type: application/json Request: /fields/config?company=edinn&session=0PY4RhPbK7YW5sbRXiwASrA2HEeCP0eGFzunnfiEJYWrp4whnU11FLESeYpB&idfield=S0000&mod=0 Reponse (success): { "status": "0", "data":true, "message": "Success" } |
PUT /fields/{id}/config
This method modify a field. 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.
- variable[mandatory]: internal name of the field. Allows to carry out statistical studies, links with algorithms (types of calculation), etc. You can change the description (field) field, but not the variable name.
- description[mandatory]: literally that appears to the working user.
- value[mandatory]: default value or the possible answers that the user could give (separated by commas).
- module [mandatory]: indicates the module where the field you want to modify is located. 0: results, 1: autocontrol.
- type: type of the field
- idcomb: if you selected the optins 7 or 12, then you shouuld specify the id of the combo.
- io: indicates to what this field should be apply (Production, Inputs, Outputs, I&O [Inputs and Outputs], etc.).
- mandat: when the field is mandatory. The options are the following:
- idcalc: calculation type to be applied to the field. This is useful to convert the values of the fields.
- fclass: this is to indicate to other computer systems the type of the field. Please see integration with other systems.
- maxlength: maximum length of the field.
- calculated: indicates if the field will be calculated by a UDL.
- locked: indicates if the field cannot be changed by the user.
- inherits: indicates if the field inherits its value from the field with the same variable name of the previous production record.
- stock: indicates if the field is used to diferentiate stock.
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.
Content-Type: application/json Request:/fields/config?company=edinn&session=0PY4RhPbK7YW5sbRXiwASrA2HEeCP0eGFzunnfiEJYWrp4whnU11FLESeYpB&results=S0000&variable=1a2s&description=testApi&values=modifiedField&mod=0&id=20210520092549AAB Reponse (success): { "status": "0", "data":true, "message": "Success" } |
DELETE /fields/{id}/config
This method deletes a configured fields. 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.
Content-Type: application/json Request:/fields/config?company=edinn&session=0PY4RhPbK7YW5sbRXiwASrA2HEeCP0eGFzunnfiEJYWrp4whnU11FLESeYpB&id=20210520092549AAB&mod=0 Reponse (success): { "status": "0", "data":true, "message": "Success" } |