Filtering

Filtering

Endpoints that list resources support filtering.

When a filter URL parameter can be used, it will be documented in the endpoint's documentation.

The parameter should be a JSON object with the following (optional) keys...

fields

Type: Object or Array

Specify fields to include in or exclude from the response.

For example:

{ fields: {location: true, timestamp: true } }

Or:

{ fields: ["location", "timestamp"] }

limit

Type: Number

Limit the number of instances to return.

For example:

{limit: 5}

order

Type: String

Specify sort order: ascending or descending.

For example:

order: 'timestamp DESC'

or for multiple properties

{ order: ['propertyName <ASC|DESC>’, 'propertyName <ASC|DESC>',...] }

skip (offset)

Type: Number

Skip the specified number of instances.

For example:

{skip: 50}

where

Type: Object

Specify search criteria; similar to a WHERE clause in SQL.

Where clauses look like:

{where: {property: value}}

Or, to use an operation

{where: {property: {op: value}}}

Where op can be one of the following:

and

logical and

{where: {and: [condition1, condition2, ...]}}

or

logical or

{where: {or: [condition1, condition2, ...]}}

gt, gte

greater than, greater than or equal

{where: {timestamp: {gt: 1510332638000 }}}

To get all points since 16:50:38 on 10 Nov 2017 (unix timestamp in milliseconds)

lt, lte

less than, less than or equal

between

True if the value is between the two specified values: greater than or equal to first value and less than or equal to second value.

{where: {timestamp: {between: [1509900638000,1510332638000] }}}

To get all points between 16:50:38 on 5 Nov 2017 and 16:50:38 on 10 Nov 2017

inq, nin

In / not in an array of values

near

For geolocations, return the closest points, sorted in order of distance. Use with limit to return the n closest points.

neq

not equal to


Lightbug API - Version 1

API for retrieving tracking data and changing settings on Lightbug tracking devices.

Accessible via: https://api.lightbug.cloud/api

This API will progressively be deprecated in favour of the version 2 API.

Authentication

Authorization for Lightbug API currently uses Bearer tokens generated from the /users/login endpoint.

You can find an overall summary of API authentication here.

Below you can enter a token to use with the API while browsing this documentation.

Tokens from both the v1 and v2 API can be used here.

Token:

Use this route to get a token for use in subsequent authenticated requests.
The id in the response is the token.
This needs to be passed in the Authorization header of subsequent requests.
For example: Authorization: h7d8j3921u091jfdwjd0j1

Lightbug Documentation