1

Creating new Unit

Тема: Creating new Unit

Hi there!
We want to create new unit using SDK but document (http://sdk.wialon.com/wiki/en/sidebar/r … reate_unit) doesn't mentioned the parameter "Unit Unique ID"!!
Would you please explain how we should create unit and/or where we should set unit unique ID?

2

Creating new Unit

Re: Creating new Unit

Hello

To set uniqueID you should use unit/update_device_type request after unit creation

3

Creating new Unit

Re: Creating new Unit

Thanks shmi
We use

$params = json_encode(array(
        'creatorId'=>'1309' ,
        'name'=> 'Payam',
        'hwTypeId'=>'96266',
        'dataFlags'=> 5
    ));

    
echo $wialon_api->core_create_unit($params);
$wialon_api->logout();

and get "error 6" response. Would you help us?

4

Creating new Unit

Re: Creating new Unit

hhamedk

Check creatorId parameter
1) it should be id of real user (try to execute core/search_item, result have to be a user)
2) user must have "Can create items" flag in user properties