Create unit

To create a new unit, use the command core/create_unit:

svc=core/create_unit&params={"creatorId":<uint>,
			     "name":<text>,
			     "hwType":<uint>}

:!: 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)
hwType device (hardware) ID

Response

You can find the format of response in the chapter Data format: Units.

Errors

Code Value
1 invalid session
2 invalid service name
3 invalid result
4 invalid format or value of parameters
6 error creating unit (could be forbidden to create elements or such element already exists )
Follow us on Facebook Gurtam Wialon Twitter Gurtam Wialon info@gurtam.com   |   Copyright © 2002-2021 Gurtam