create_unit

The create_unit function is used to create new units.

Copied!
svc=core/create_unit&params={"creatorId":<long>,
			     "name":"<text>",
			     "hwTypeId":<long>,
			     "dataFlags":<long>}

Parameters

NameDescription

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

Copied!
{
	"item":{	/* unit created */
		...	
	},
	"flags":<uint>	/* applied flags with properties */
}

The format of the item parameter is described on the unit page.

Possible error codes:

CodeDescription
7The creator is a top account or the create_units billing transaction failed. 
6Failed to fetch user creator or failed to create unit.
4Wrong input parameters.
Download PDF file
Download Word document

See also