GET /api/units
<?xml version="1.0" encoding="UTF-8"?> <units type="array" page="1" per_page="100" total="2"> <unit> ... </unit> <unit> ... </unit> </units>
GET /api/units?name=hour
Shows all units with the term “hour” in their name. It doesn’t matter if you use upper– or lowercase.
The following parameters can be used:
Parameter | Description |
---|---|
name | Name of the unit |
GET /api/units/{id}
<?xml version="1.0" encoding="UTF-8"?> <unit> <id type="integer">1</id> <created type="datetime">2007-12-13T12:12:00+01:00</created> <name>hour</name> </unit>
POST /api/units
XML element | Description | Type | Default value | Mandatory |
---|---|---|---|---|
name | Name of the unit | ALNUM | yes |
<unit> <name>Piece</name> </unit>
<?xml version="1.0" encoding="UTF-8"?> <unit> <id type="integer">1234</id> <created type="datetime">2007-12-13T12:12:00+01:00</created> <name>Piece</name> </unit>
PUT /api/units/{id}
<unit> <name>pallets</name> </unit>
DELETE /api/units/{id}
You cannot delete units while they are assigned to any articles.