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: { "session": "cJvqHJcEssmpGukxrZF73migL5M4LVUZniyesQHBatOvTkrbpkYgrHKvfVpP", "company": "demo01" } 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 meausre 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: { "session": "cJvqHJcEssmpGukxrZF73migL5M4LVUZniyesQHBatOvTkrbpkYgrHKvfVpP", "company": "demo01", "id": "UnitId" } 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: { /units/UnitId } { "session": "cJvqHJcEssmpGukxrZF73migL5M4LVUZniyesQHBatOvTkrbpkYgrHKvfVpP", "company": "demo01" } Response: { "status": 0, "data": null, "message": "Success" } |