1

Remote API using new autorization

Тема: Remote API using new autorization

Please help to share sample to use Remote APi using new authorization.
This information  https://forum.gurtam.com/viewtopic.php?id=6768 not valid anymore regarding the new auth method.

I try to understand the information in https://sdk.wialon.com/wiki/en/sidebar/ … ogin/login and https://sdk.wialon.com/wiki/en/sidebar/ … ken/update but found no simple sample and step procedure.

Thanks,
PaulPak

2

Remote API using new autorization

(11/05/2018 12:59:53 отредактировано rual)

Re: Remote API using new autorization

You can view example on Playground: https://sdk.wialon.com/playground/demo/app_auth_token

You need to use http://hosting.wialon.com/login.html , with url parameters described at https://sdk.wialon.com/wiki/en/sidebar/ … ogin/login

If authorization was successful, login.html redirect you to the specified redirect_uri with access_token or access_hash parameters.

3

Remote API using new autorization

(21/05/2018 16:40:18 отредактировано kaippally)

Re: Remote API using new autorization

1) Load the web form http://hosting.wialon.com/login.html
2) Enter your user login and password, press "login" If authorisation was ok, in the web address field you will get the response with the token like  http://hosting.wialon.com/login.html?access_token=5bbfe4a4ad20f61f466ae093aeb811d3BB4432702CE8BC771547D35F32E0A0E64FAE40B6&svc_error=0
3) Copy the 72 character value after access_token from  the URL access_token=5bbfe4a4ad20f61f466ae093aeb811d3BB4432702CE8BC771547D35F32E0A0E64FAE40B6- this will be your token

4) With token, you will be able to login with the following query.

https://hst-api.wialon.com/wialon/ajax.html?svc=token/login&params={"token":"5bbfe4a4ad20f61f466ae093aeb811d3BB4432702CE8BC771547D35F32E0A0E64FAE40B6"} 

This will yield several parameters. Copy the value in eid.

For all subsequent queries you will use the eid from the login response as the sid (Session Id)
For example In order to search for all units you will perform the following query


https://hst-api.wialon.com/wialon/ajax.html?svc=core/search_items&params={"spec": {
                    "itemsType": "avl_unit",
                    "propName": "sys_name",
                    "propValueMask": "*",
                    "sortType": "sys_name"
                },
                "force": 1,
                "flags": "1",
                "from": 0,
                "to": 0
            }&sid=0416be7911e7a2cedd6bba0ae68e9c4e

Good luck

Nishad Hussain Kaippally
Implementation Specialist, Middle East, Gurtam

"Computer science is no more about computers than astronomy is about telescopes."
4

Remote API using new autorization

Re: Remote API using new autorization

Perfecto...

Thanks Nizad and Rual!

5

Remote API using new autorization

Re: Remote API using new autorization

Regards,

I want to know how I can select a different time zone than the ones 
that the platform has pre-established. For example in "User 
Parameters" / "Time Zone" (-05: 00) Eastern Time (USA and Canada)

We need to use (UTC-05: 00) Bogotá, Lima, Quito, Rio Branco

The reports currently go out with the area (-05: 00) Eastern Time (USA 
and Canada) and for us it is an error because it does not match our 
schedule

Thank you

  • Remote API using new autorization
6

Remote API using new autorization

Re: Remote API using new autorization

Hello!

ozchamorrito , by default (through Remote API requests) report is executed and returns result in UTC+0 timezone.

If you would like to get result in some other time zone, after login you need to execute request render/set_locale to set up required timezone - parameter tzOffset
Please note sometime it needs to use URL encoded for characters, for example , symbols '%'. Please look example to set up timezone UTC-05: 00

 http://hst-api.wialon.com/wialon/ajax.html?svc=render/set_locale&sid=017642a31bf86ba5f0cfc06d8c3bfbf0&params={"tzOffset":-134170192,"language":"ru","flags":256,"formatDate":"%25Y-%25m-%25E %25H:%25M:%25S"}
Diana Cheley
Wialon Hosting Expert
Gurtam