09-22-2021 11:29 AM - last edited on 01-17-2024 01:40 PM by Sabah Kadir
I am trying out the DNA Spaces api. The Swagger documentation is good (https://developer.cisco.com/docs/dna-spaces/#!dna-spaces-location-cloud-api), but I have not figured out how to add parameters, for example:
https://dnaspaces.io/api/location/v1/history?limit=100
or
https://dnaspaces.io/api/location/v1/history?startTime=2021-09-21T00:00:00Z&endTime=2021-09-22T23:59:59
I would think that this limits the results, but I am getting this every time:
{"code":5000,"message":"There are 764657 records in request time range, more than the limit 50000. Please reduce the time range."}
Can someone provide an example? I also tried putting the parameters in the body but that does not work either.
Solved! Go to Solution.
09-22-2021 01:11 PM
The time parameters should be by Unix binary time in UTC. For example
https://dnaspaces.io/api/location/v1/history?startTime=1632182400000&endTime=1632229199000
09-22-2021 01:11 PM
The time parameters should be by Unix binary time in UTC. For example
https://dnaspaces.io/api/location/v1/history?startTime=1632182400000&endTime=1632229199000
09-22-2021 01:13 PM
Very helpful. Thank you for the response.
05-26-2023 02:12 PM - edited 05-26-2023 02:12 PM
Hi,
Sorry about the limit param. The usage is right, but this functionality will be available after 2weeks.
Also I would like to share few info on the API:
1. The startTime and endTime has to be in Unix epoch-milliseconds as mentioned in miczhao's reply below.
2. If start and end time are not given, then system will use a default time range of last 24hrs.
3. If you encounter {"code":5000,"message":"There are 764657 records in request time range, more than the limit 50000. Please reduce the time range."} error, pls give startTime and endTime in the request with lesser time range
ex: https://dnaspaces.io/api/location/v1/history?startTime=1685048502000&endTime=1685134903000
Regards,
Andal
06-12-2023 08:02 PM
Hi,
The limit query param is available to use on the export API. The value of limit is expected to be between 1 and 50000.
Example:
https://dnaspaces.io/api/location/v1/history?startTime=1686366023000&endTime=1686452423000&limit=100
OR
https://dnaspaces.io/api/location/v1/history?limit=100
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide