1

Error using $wialon_api->messages_load_interval

(06/12/2021 11:54:28 отредактировано Snakebytes888)

Тема: Error using $wialon_api->messages_load_interval

Hi there!

I am trying to load the messages using an Class i downloaded from Github but i am getting an error saying:

{"error":4,"reason":"WRONG_PARAMS"}

Here is my code:

<?php
    include('wialon.php');
    $wialon_api = new Wialon();

    // old username and password login is deprecated, use token login
    $token = 'mytokenhere';
    $result = $wialon_api->login($token);
    $json = json_decode($result, true);
    if(!isset($json['error'])){

        echo $wialon_api->messages_load_interval('{"unit":24611387,"timeFrom":1073741831,"timeTo":1638201710,"flags":0x0001,"flagMask":0xFF01,"loadCount",100}');

       
        $wialon_api->logout();
    } else {
        echo WialonError::error($json['error']);
    }

?>

Thank you

2

Error using $wialon_api->messages_load_interval

Re: Error using $wialon_api->messages_load_interval

Try to change flags parameter
"flags":0x0001 -> "flags":1

3

Error using $wialon_api->messages_load_interval

Re: Error using $wialon_api->messages_load_interval

Thank you shmi. i tried that too, but i still get the same error.

4

Error using $wialon_api->messages_load_interval

Re: Error using $wialon_api->messages_load_interval

You get WRONG_PARAMS response because you pass wrong parameters. Check https://sdk.wialon.com/wiki/en/sidebar/ … d_interval

unit- > itemId
"flagMask":0xFF01 -> "flagMask":65281

5

Error using $wialon_api->messages_load_interval

Re: Error using $wialon_api->messages_load_interval

Thanks a lot shmi! it is now working!