1

Error in PHP - '=>' (T_DOUBLE_ARROW)

Тема: Error in PHP - '=>' (T_DOUBLE_ARROW)

Hi all,

I would like to ask for help as I am not fully educated in IT development. I am using Wialon local and sending the requests via PHP.
I am trying to request the list of IDs (Search items by property). Unfortunately I am facing the following problem

Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ')'

The source looks as follow:

$params - array("spec"(
            "itemsType" => "avl_unit",
            "propName" => "sys_id",
            "propValueMask" => "*",
            "sortType" => "sys_name"),
            "force" => 1,
            "flags" => 1,
            "from" => 0,
            "to" => 10000
    );
   
echo $wialon_api->core_search_items(json_encode($params));

Can anyone help how to make this request / substitute the => for anything else?

Thanks in advance

2

Error in PHP - '=>' (T_DOUBLE_ARROW)

Re: Error in PHP - '=>' (T_DOUBLE_ARROW)

=> is fine. But try this one:

$params = array(    
    "spec" => array(
        "itemsType" => "avl_unit",
        "propName" => "sys_id",
        "propValueMask" => "*",
        "sortType" => "sys_name"
    ),
    "force" => 1,
    "flags" => 1,
    "from" => 0,
    "to" => 10000
);
3

Error in PHP - '=>' (T_DOUBLE_ARROW)

Re: Error in PHP - '=>' (T_DOUBLE_ARROW)

Hi.

thx for the reply.
It works.

But I have another problem.
I wanna get information about one item / fuel consumption https://sdk.wialon.com/wiki/en/local/re … vel_params

It gives me respond back "error=7" - Access denied

There is everything the same like in other requests.

Where can be the mistake?

$params = array(
           "itemId" => 63702,
           "flags" => 0x245,
            "ignoreStayTimeout" => 0,
            "minFillingVolume" => 0,
            "minTheftTimeout" => 0,
            "minTheftVolume" => 0,
            "filterQuality" => 0,
            "fillingsJoinInterval" => 0,
            "theftsJoinInterval" => 0,
            "extraFillingTimeout" => 0
        );
           


    echo $wialon_api->unit_update_fuel_level_params(json_encode($params));

4

Error in PHP - '=>' (T_DOUBLE_ARROW)

Re: Error in PHP - '=>' (T_DOUBLE_ARROW)

Hello!

Please check the access rights to unit in user hierarchy, also the access rights via token with which login
May be also there is not correct  "itemId". Do you use Wialon Local or Wialon Hosting?

Diana Cheley
Wialon Hosting Expert
Gurtam