App API

Series of routes which are used to interact with assets, configuration, operational and emission data in Validere

https://api.validere.io/app

All top-level API resources have support for bulk fetches through “search” API methods. For example, you can list facilities, list equipment, and list devices. These search API methods share a common structure and accept common parameters: page, page_size, sort_by, sort_direction and filter.

Pagination parameters

  • page: An index for the page number for pagination across multiple pages of results. Omitting this will return the first page of results.

  • page_size: A limit on the number of objects to be returned per page

  • sort_by: Attribute to order the searched results by, similar to ORDER BY in SQL

  • sort_direction: Direction to order the sorted results, supports asc and desc

Filtering

Search APIs accept a filter parameter which supports a query string similar to Mongo to help improve the efficiency of a search request and to reduce unnecessary traffic.

  • For equality: use <field>:<value> expressions

{ <field1>: <value1>, ... }

Example, search all equipment where status equals active

{ "status": "active" }
  • For multiple conditions use the following form

{ <field1>: { <operator1>: <value1> }, ... }

Example, search all equipment where status equals either active or unknown

{ "status": { $in: [ "active", "unknown" ] } }
  • For multiple AND conditions, add additional key-value pairs to the filter object Example, search all equipment where status is active AND region is Canada

{ "status": "active", "region": "Canada" }
  • For multiple OR conditions, use the $or operator. Each argument in the subsequent list is a separate clause. Example, search all equipment where status is active OR region is USA

{ "$or": [{"status": "active"}, {"region": "USA"}] }
  • Combining AND and OR Either status is unknown OR (active AND in USA)

{ "status": "unknown", "$or": [{"status": "active"}, {"region": "USA"}] }

Last updated