create_unit
The create_unit function is used to create new units.
svc=core/create_unit¶ms={"creatorId":<long>,
"name":"<text>",
"hwTypeId":<long>,
"dataFlags":<long>}
Parameters
Name | Description |
---|---|
creatorId | The ID of the user that should be the unit creator. |
name | Unit name (4–50 characters). |
hwTypeId | Device (hardware) ID. |
dataFlags | Flags with the unit properties for the returned result (see the unit page). |
Returned result
{
"item":{ /* unit created */
...
},
"flags":<uint> /* applied flags with properties */
}
The format of the item parameter is described on the unit page.
Possible error codes:
Code | Description |
---|---|
7 | The creator is a top account or the create_units billing transaction failed. |
6 | Failed to fetch user creator or failed to create unit. |
4 | Wrong input parameters. |