cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1639
Views
11
Helpful
4
Replies

DNA Spaces API Examples

smoore4moma
Level 1
Level 1

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.

1 Accepted Solution

Accepted Solutions

miczhao
Cisco Employee
Cisco Employee

The time parameters should be by Unix binary time in UTC. For example 

https://dnaspaces.io/api/location/v1/history?startTime=1632182400000&endTime=1632229199000

 

View solution in original post

4 Replies 4

miczhao
Cisco Employee
Cisco Employee

The time parameters should be by Unix binary time in UTC. For example 

https://dnaspaces.io/api/location/v1/history?startTime=1632182400000&endTime=1632229199000

 

Very helpful. Thank you for the response.

apydakul
Cisco Employee
Cisco Employee


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

 

apydakul
Cisco Employee
Cisco Employee

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