To create a new unit, use the command core/create_unit:
svc=core/create_unit¶ms={"creatorId":<long>, "name":<text>, "hwTypeId":<long>, "dataFlags":<long>}
You can find an example of this request in the sample Creating, editing and deleting items.
Parameters
Name | Description |
---|---|
creatorId | ID of a user who will be assigned a creator for a new unit |
name | new unit name (at least 4 characters) |
hwTypeId | device (hardware) ID |
dataFlags | data flags for the response (see Data format: Units) |
Response
{ "item":{ /* unit created */ ... }, "flags":<uint> /* applied data flags */ }
You can find the format of “item” in the chapter Data format: Units.