-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
THE CURRENT EXAMPLE DON'T WORK
Filtering syntax
Custom filtering is implemented using the python syntax for mongo query filters, see mongo db documentation for all the available.
e.g. if we want to filter only the echo messages our call would be something like the following:
curl -b iottly_cookie -H 'Content-Type: application/json' https://iottly.com/v1.0/project/<project id>/messages/<device id>?queryJson=%7B%22echo%22%3A%20%7B%22%24exists%22%3A%20true%7D%7D
where the queryJson contains the url encoded representation of the following JSON:
{
"echo": {
"$exists": true
}
}
Paginating results
FIXME: example does not work :(
Pagination can be implemented using the queryJson to filter the data by timestamp:
curl -b iottly_cookie -H 'Content-Type: application/json' https://iottly.com/v1.0/project/<project id>/messages/<device id>?queryJson=%7B%0D%0A%20%20%20%20%22timestamp%22%3A%20%7B%0D%0A%20%20%20%20%20%20%20%20%22%24lte%22%3A%20%7B%22%24date%22%3A%20%222017-04-19T10%3A47%3A58.133%22%7D%0D%0A%20%20%20%20%7D%0D%0A%7D
where the queryJSON contains the url encoded representation of the following JSON:
{
"timestamp": {
"$lte": {"$date": "2017-04-19T10:47:58.133Z"}
}
}
Reactions are currently unavailable