nrfCloud Location History via REST API

Hi,

When calling https://api.nrfcloud.com/v1/location/history, The records start chronologically from old to new. Is there a way to only get the most recent location update instead of having to fetch all the pages to get to it? Alternatively, is it possible to change the sort order so that location history is returned "new-to-old" instead of "old-to-new"?

Kind Regards,
Iman Biglari

Parents
  • Hello,

    Is there a way to only get the most recent location update instead of having to fetch all the pages to get to it?

    The API documentation mentions a "pageLimit" parameter that can be used to limit the number of pages. Have you tried that? I'm not sure if it will return the most recent pages though.

  • 0
    56 pts.
    in reply to Hakon

    Hi Hakan,

    I'm afraid using pageLimit does not change the order of entries returned. Oldest position report is still the first record returned.

    What I need is a way to fetch device's latest reported position only, regardless of its source (A-GPS / GNSS). Does such a function exist in your REST API?

    I have been working on my own cloud driver to replace nrfCloud / AWS / Azure driver that comes with asset_tracker_v2, but couldn't find an easy way to merge the changes in 1.7x branch into my code (which was based on 1.6.1). That's why I decided to revert back to nrfCloud and try and fetch the location data via REST API.

Reply
  • 0
    56 pts.
    in reply to Hakon

    Hi Hakan,

    I'm afraid using pageLimit does not change the order of entries returned. Oldest position report is still the first record returned.

    What I need is a way to fetch device's latest reported position only, regardless of its source (A-GPS / GNSS). Does such a function exist in your REST API?

    I have been working on my own cloud driver to replace nrfCloud / AWS / Azure driver that comes with asset_tracker_v2, but couldn't find an easy way to merge the changes in 1.7x branch into my code (which was based on 1.6.1). That's why I decided to revert back to nrfCloud and try and fetch the location data via REST API.

Children
Related