1

JS SDK - Get Routes and extra fields

(edited by gustavodbs 09/01/2019 16:25:22)

Topic: JS SDK - Get Routes and extra fields

Hello,

Can you please indicate how to get the route associated with a unit through the JS SDK?
I need to replicate the information that you see in the screenshot in a mobile application

Also, are there in somewhere a list of available flags for queries? What I'm looking for is all the information that can be obtained through the JS SDK

And one last query, is it safe to use the JS SDK in a hybrid application? The token would be exposed to any user who can analyze the app.

Thanks!

2

JS SDK - Get Routes and extra fields

Re: JS SDK - Get Routes and extra fields

Hello!
1. You can find all documentation about Nimbus API (REST requests) here
2. In order to your screenshot if you need to get Stops you can execute request 'Get all the stops of the depot'
3. For Nimbus app there is not JS SDK, only REST API
4. What do you mean about hybrid app? Regarding token in your app you can use (create) token with limited access, please look more information here

Diana Cheley
Wialon Hosting Expert
Gurtam
3

JS SDK - Get Routes and extra fields

Re: JS SDK - Get Routes and extra fields

Good morning,

Thank you very much for answering!

At the time of posting I did not know that I could obtain the units and routes through the Nimbus API, for that reason I was using the JavaScript SDK (https://sdk.wialon.com/playground/demo/get_units).

I got to find this for the JavaScript SDK (https://sdk.wialon.com/api/index.html#wialon.item.Route) but so far I could not get the routes (I don't know how).

About the point number 4, the token that I referred, is this
// http://sdk.wialon.com/playground/demo/app_auth_token
wialon.core.Session.getInstance (). loginToken ("", "", "")

But now I'm testing the Nimbus API to see if I can get all the data I need for the application.

Regards!

4

JS SDK - Get Routes and extra fields

(edited by gustavodbs 11/01/2019 21:37:50)

Re: JS SDK - Get Routes and extra fields

Hello,

After spending some time testing the nimbus API, I be able finally to draw the route on the map.

Now I have another problem, I want to be able to move the units across the map.

Could someone tell me how to get a list of units with their respective positions (with Nimbus API), to be able to show on a map the movement of them?

5

JS SDK - Get Routes and extra fields

Re: JS SDK - Get Routes and extra fields

You can use Wialon API for getting postion of units.

First add the required events
Then query the events periodically
To get position you should use flag 1024

Here is documentation on Data Flags for units

Nishad Hussain Kaippally
Implementation Specialist, Middle East, Gurtam

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

JS SDK - Get Routes and extra fields

Re: JS SDK - Get Routes and extra fields

Thank you very much for the help, I'm getting the positions through the Wialon API and now I can continue with the development of the app.

Regards!

7

JS SDK - Get Routes and extra fields

Re: JS SDK - Get Routes and extra fields

Hello,

Again I have a question regarding routes and units.

How I can to know when a unit is associated with a specific route?
Because I consult the endpoint of "routes" with nimbus API, and all the routes returns me the same array of units

Is there any example to get data like locator https://nimbus.wialon.com/locator/? I can't find anything in github, stackoverflow or google, and docs confuses me a little

Thanks!