1

How to get both id and position information in single search api call

(edited by roshan.chhetri 05/07/2017 23:18:12)

Topic: How to get both id and position information in single search api call

I used below api request to get the last known position of all machines:

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

But it does not give me the information about the device id.

How can i find it?
I can do search by id but I want to find the information for all machine in a single api call.

I tried batch call also,

search_url = 'http://hst-api.wialon.com/wialon/ajax.html?svc=core/batch&params=['all_ids and flag=1024']&sid=' + session_id

but once I provide ids in batch , the response does not have the id hence i cannot differenciate the devices

2

How to get both id and position information in single search api call

Re: How to get both id and position information in single search api call

Hello
You can combine flags to get all needed information

From docs
1 - base flag
1024 - last message and position
Send flags=1025 if you need both

3

How to get both id and position information in single search api call

Re: How to get both id and position information in single search api call

roshan.chhetri wrote:

Thanks it worked, the information "t" in the response is the timestamp in seconds?

Yes, we use Unix time

Response format here

4

How to get both id and position information in single search api call

Re: How to get both id and position information in single search api call

Good post, thanks!

5

How to get both id and position information in single search api call

Re: How to get both id and position information in single search api call

thanks