Configuration
This section handles the resources configuration. Please notice that this was changed to 'recourses' instead of 'resources' as this last is a reserved word in URLs.
GET /recourses/config/{id}
This method returns the list of resources for the user.
Request parameters:
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- id: The Id of the recourse.
Response:
- status: returns "0" on success, and an error code in any other case.
- data: returns the list of resources and its descriptions.
- message: "success" or a descriptive information of the error in any other case.
Example:
Request: { "session": "cJvqHJcEssmpGukxrZF73migL5M4LVUZniyesQHBatOvTkrbpkYgrHKvfVpP", "company": "demo01" } Response: { "status": "0", "data": { "id": "USER", "name": "", "lastname": "", "language": "en", "email01": "user@edinn.com", "email02": "", "code": "", "tooltips": "0", "y0": "0", "g0": "0", "areas": "A0001", "processes": "P0001", "process": "", "roles": "548682072063", "password": "03ac674216f3e15c761ee1a5e255f067953623c8b388b4459e13f978d7c846f4", "fields_production": "", "fields_autocontrol": "", "user": "", "expire": "", "scheduleatstart": "0", "alertsweekdays": "0", "alertstype": "0", "alertsat": "", "alertssent": "", "sso": "", "maxunits": "0,00", "decimalsymbol": ",", "schedulefields": "0", "orderschefields": "0", "notify":"1", "maximun_time":"0" }, "message": "Success" } |
POST /recourses/config
This method creates a resource. The user must have the administrator role.
Request parameters (for additional information please review the resources configuration):
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- id [mandatory]: the id of the resource.
- pass [mandatory]: the password of the resource.
- name: name of the person.
- lastname: last name of the person
- language: to configure the system when the user connects to the system.
- email01: used to:
- receive notifications or comments that are sent through the comments system.
- list of the autocontrol tasks that are about to expire.
- indications of what messages, in the communication flow between edinn and other systems (ERP, etc.), have failed and require manual intervention.
- email02: used to:
- receive notifications of not done autocontrol tasks.
- receive notifications of processes that are stopped more than a certain time.
- code: code for quick access from the login window. This is useful for card readers, so that the user just passes the card and automatically logs in the system.
- tooltips: if 1, help tags will appear on screen to the user next time he logs in.
- y0: yellow target of activity.
- g0: green target of activity.
- areas: if the user is restricted to access only the process of certain areas. Indicate them separated by commas: AREA1,AREA2. The user will only be able to see the areas indicated here. Leave blank to see all areas.
- processes: if the user is restricted to access only these processes. Indicate them separated by commas: PROC1,PROC2. The user will only be able to see the processes indicated here. Leave blank to see al processes.
- associated process: this is useful when a process is a person. With this field the selected person will be associated with that particular process.
- roles (permissions or security): please see the available roles in resources configuration. You should check if the bit of the corresponding role number (substracting 1 as they start in the bit zero) is active in this number.
- expire: after this date, the person will not be able to access the system, will not be shown in the resources (persons) list at the login page nor will be able to access the reports tool.
- scheduleatstart: what should happen when a new work order is started, to pause, to prefinish or to finish the work order which is being processed in that moment.
- fields_production: indicates the customized product fields that will be visible for the user.
- fields_autocontrol: indicates the customized autocontrol tasks fields that will be visible for the user.
- alertsweekdays: the days that the user will receive alerts.
- alertstype: the type alerts the user will receive.
- alertsat:the time at that the user will receive alerts.
- alertssent: indicates if the user will receive alerts.
- sso: single sing on, enables the user to autoload when starting the session in the computer.
- maxunits: the maximun number of recourses that can be used at the same time.
- decimalsymbol: indicates which symbol will be used for this resource to indicate decimals.
- schedulefields: is a combination of bits to indicate which columns of the data grid in the Schedule window are visible for this resource.
- orderschefields: if different of zero the system will allow this resource (user) to sort the data table in the Schedule window by any visible column. Otherwise, the table will be automatically sorted by the WBS column.
- notify: if 0 the user will not be notified about changes in the status of work orders.
- template_proc: template process. If indicated, it makes a copy of the indicated process and establishes it as the process associated with the person. It is useful in work management.
- maximun_time: Maximum uninterrupted time in seconds that the resource can be IN in a process. After this time, the system will automatically OUT. If left at zero, it will not be applied.
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: { "session": "cJvqHJcEssmpGukxrZF73migL5M4LVUZniyesQHBatOvTkrbpkYgrHKvfVpP", "company": "demo01", "id": "USER", "pass": "1234" } Response: { "status": 0, "data": null, "message": "Success" } |
POST /recourses/config (ISA-95 compliant, for more information please read the B2MML document)
This method creates a new resources using json encoded B2MML data. The user must have the administrator role.
Request parameters (for additional information please review the resources configuration):
- company [mandatory]: The company name or id.
- session [mandatory]: The Id of the active session.
- data [mandatory]: The json encoded B2MML data defining the resource.
Response:
- status: Returns "0" on success, and an error code in any other case.
- data: the json encoded B2MML data with the response.
- message: "Success" or a descriptive information of the error in any other case.
Example:
{ "SyncPerson":{ "ApplicationArea":{ "Sender":{ "ComponentID":"ERP", "ConfirmationCode":"Always" }, "CreationDateTime":"2012-10-23T16:30:32" }, "DataArea":{ "Sync":{ "ActionCriteria":{"ActionExpression":{"@actionCode":"Add"}} }, "Person":{ "ID":"PERS1", "PersonName":"Name", "PersonProperty":[ {"ID":"Roles","Value":{"ValueString":"11325423","DataType":"integer","UnitOfMeasure":""}}, {"ID":"Pass","Value":{"ValueString":"1234","DataType":"string","UnitOfMeasure":""}}, {"ID":"Lang","Value":{"ValueString":"ES","DataType":"string","UnitOfMeasure":""}}, {"ID":"Email01","Value":{"ValueString":"pers01@enterprise.com","DataType":"string","UnitOfMeasure":""}}, {"ID":"Email02","Value":{"ValueString":"pers02@enterprise.com","DataType":"string","UnitOfMeasure":""}}, {"ID":"Tooltips","Value":{"ValueString":"0","DataType":"integer","UnitOfMeasure":""}}, {"ID":"Lines","Value":{"ValueString":"L1","DataType":"string","UnitOfMeasure":""}}, {"ID":"LastName","Value":{"ValueString":"Doe","DataType":"string","UnitOfMeasure":""}}, {"ID":"Code","Value":{"ValueString":"12345678","DataType":"string","UnitOfMeasure":""}}, {"ID":"Id_Proc","Value":{"ValueString":"WK1","DataType":"string","UnitOfMeasure":""}}, {"ID":"Expire","Value":{"ValueString":"20130131235959","DataType":"string","UnitOfMeasure":""}}, {"ID":"Processes","Value":{"ValueString":"WK1,WK2","DataType":"string","UnitOfMeasure":""}}, {"ID":"Name","Value":{"ValueString":"John","DataType":"string","UnitOfMeasure":""}} ], "Location":{ "EquipmentID":"COMP1", "EquipmentElementLevel":"Enterprise", "Location":{ "EquipmentID":"P1", "EquipmentElementLevel":"Site", "Location":{ "EquipmentID":"PL1", "EquipmentElementLevel":"ProductionLine" } } } } } } } |
Response example:
{ "status":"0", "data":"{ \"ConfirmBOD\":{ \"ApplicationArea\":{ \"Sender\":{\"ComponentID\":\"EDINN\",\"ConfirmationCode\":\"Always\"},\"CreationDateTime\":\"2019-11-12T13:16:27\" }, \"DataArea\":{ \"Confirm\":{\"ResponseCriteria\":{\"ResponseExpression\":{\"@actionCode\":\"Accepted\"}}}, \"BOD\":{\"Description\":\"SyncPerson\",\"Note\":\"Person PERS1 inserted successfully\"}} } }", "message":"Success" } |
DELETE /recourses/config/{id}
This method deletes a resource. The user must have the administrator role.
Request attribute:
- id: the Id of the device to delete.
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.
Request: { "session": "cJvqHJcEssmpGukxrZF73migL5M4LVUZniyesQHBatOvTkrbpkYgrHKvfVpP", "company": "demo01" } Response: { "status": 0, "data": null, "message": "Success" } |