Configuration
This section handles the measure units configuration.
GET /units
This method returns the list of measures units.
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: returns the list of measures units.
- message: "Success" or a descriptive information of the error in any other case.
Request: {"type":"get", "url":"units", "data":"company=demo01&session=cJvqHJcEssmpGukxrZF73migL5M4LVUZniyesQHBatOvTkrbpkYgrHKvfVpP"} Response: { "status": "0", "data": [ { "order": "00000", "name": "piezas" } "message": "Success" } |
POST /units
This method creates a unit. The user must have the administrator role.
Request parameters (for additional information please review the measure units configuration):
- company [mandatory]: the company name or id.
- session [mandatory]: the Id of the active session.
- name [mandatory]: the name of the measure unit.
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":"units", "data":"company=demo01&session=cJvqHJcEssmpGukxrZF73migL5M4LVUZniyesQHBatOvTkrbpkYgrHKvfVpP&name=Unitld"} Response: { "status": 0, "data": null, "message": "Success" } |
DELETE /units/{id}
This method deletes a unit. The user must have the administrator role.
Request attribute:
- id [mandatory]: the name of the unit 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: {"type":"delete", "url":"units/Unitld", "data":"company=demo01&session=cJvqHJcEssmpGukxrZF73migL5M4LVUZniyesQHBatOvTkrbpkYgrHKvfVpP"} Response: { "status": 0, "data": null, "message": "Success" } |