aWhere Manual
DevelopAPIitem-services

Queries

Find Records, aggregate them and read the statistics of a field.

POST
/api/item/{id}/actions/aggregate

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

Request Body

application/json
  1. body

The stages of the pipeline.

[index: integer]?

Response Body

The result of the pipeline.

application/json
  1. response
@meta?

The name and version of the service that answered.

data?array<>
curl -X POST "https://platform.example.com/api/item/$ITEM_ID/actions/aggregate" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '[  {    "$match": {      "status": "open"    }  },  {    "$group": {      "_id": "$district",      "count": {        "$sum": 1      }    }  }]'
{  "@meta": {},  "data": [    {}  ]}
POST
/api/item/{id}/actions/field-stats

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

Request Body

application/json
  1. body
fields?array<string>

The ids of the fields.

sampleLimit?integer

How many Records to look at.

Response Body

The statistics, by field.

application/json
  1. response
@meta?

The name and version of the service that answered.

data?
curl -X POST "https://platform.example.com/api/item/$ITEM_ID/actions/field-stats" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "fields": [],  "sampleLimit": 0}'
{  "@meta": {},  "data": {}}
GET
/api/item/{id}/actions/find

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

Query Parameters

keyword?string

Words to look for.

query?string

A filter, as a JSON object.

select?string

The fields to return, as a JSON object of field names to 1 or 0.

skip?integer

How many to skip.

limit?integer

How many to return; 10 when absent.

Default10
sort?string

The order, as a JSON object of field names to 1 or -1.

rawValue?boolean

Return the stored values, not the ones formatted for display.

Defaultfalse
rawField?boolean

Name the fields by their id, not by their display name.

Defaultfalse
format?string

The format of the answer.

Default"json"
Value in"json""geojson""csv"
formatOptions?string

Options of the format, as a JSON object.

Response Body

The Records on this page, and how many match.

application/json
  1. response
@meta?

The name and version of the service that answered.

total?integer

How many match, before skip and limit.

data?array<>

The Records.

curl -X GET "https://platform.example.com/api/item/$ITEM_ID/actions/find" \  -H "Authorization: Bearer $TOKEN"
{  "@meta": {},  "total": 0,  "data": [    {}  ]}
POST
/api/item/{id}/actions/find

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

Request Body

application/json
  1. body
keyword?string

Words to look for.

query?

A filter, as a JSON object.

select?

The fields to return, as a JSON object of field names to 1 or 0.

skip?integer

How many to skip.

limit?integer

How many to return; 10 when absent.

Default10
sort?

The order, as a JSON object of field names to 1 or -1.

rawValue?boolean

Return the stored values, not the ones formatted for display.

Defaultfalse
rawField?boolean

Name the fields by their id, not by their display name.

Defaultfalse
format?string

The format of the answer.

Default"json"
Value in"json""geojson""csv"
formatOptions?

Options of the format, as a JSON object.

Response Body

The Records on this page, and how many match.

application/json
  1. response
@meta?

The name and version of the service that answered.

total?integer

How many match, before skip and limit.

data?array<>

The Records.

curl -X POST "https://platform.example.com/api/item/$ITEM_ID/actions/find" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "keyword": "string",  "query": {},  "select": {}}'
{  "@meta": {},  "total": 0,  "data": [    {}  ]}
GET
/api/item/{id}/actions/getLookupData/{fieldId}

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

fieldId*string

The id of the field, as in the Item's schema.

Query Parameters

keyword?string

Words to look for.

query?string

A filter, as a JSON object.

select?string

The fields to return, as a JSON object of field names to 1 or 0.

skip?integer

How many to skip.

limit?integer

How many to return; 10 when absent.

Default10
sort?string

The order, as a JSON object of field names to 1 or -1.

rawValue?boolean

Return the stored values, not the ones formatted for display.

Defaultfalse
rawField?boolean

Name the fields by their id, not by their display name.

Defaultfalse
format?string

The format of the answer.

Default"json"
formatOptions?string

Options of the format, as a JSON object.

Response Body

The values.

application/json
  1. response
@meta?

The name and version of the service that answered.

total?integer

How many match, before skip and limit.

data?array<>
curl -X GET "https://platform.example.com/api/item/$ITEM_ID/actions/getLookupData/$FIELD_ID" \  -H "Authorization: Bearer $TOKEN"
{  "@meta": {},  "total": 0,  "data": [    {}  ]}
POST
/api/item/{id}/actions/getLookupData/{fieldId}

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

fieldId*string

The id of the field, as in the Item's schema.

Request Body

application/json
  1. body
keyword?string

Words to look for.

query?

A filter, as a JSON object.

select?

The fields to return, as a JSON object of field names to 1 or 0.

skip?integer

How many to skip.

limit?integer

How many to return; 10 when absent.

Default10
sort?

The order, as a JSON object of field names to 1 or -1.

rawValue?boolean

Return the stored values, not the ones formatted for display.

Defaultfalse
rawField?boolean

Name the fields by their id, not by their display name.

Defaultfalse
format?string

The format of the answer.

Default"json"
formatOptions?

Options of the format, as a JSON object.

[key: string]?any

Response Body

The values.

application/json
  1. response
@meta?

The name and version of the service that answered.

total?integer

How many match, before skip and limit.

data?array<>
curl -X POST "https://platform.example.com/api/item/$ITEM_ID/actions/getLookupData/$FIELD_ID" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "keyword": "string",  "query": {},  "select": {}}'
{  "@meta": {},  "total": 0,  "data": [    {}  ]}
GET
/api/item/{id}/actions/query

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

Query Parameters

keyword?string

Words to look for.

query?string

A filter, as a JSON object.

select?string

The fields to return, as a JSON object of field names to 1 or 0.

skip?integer

How many to skip.

limit?integer

How many to return; 10 when absent.

Default10
sort?string

The order, as a JSON object of field names to 1 or -1.

rawValue?boolean

Return the stored values, not the ones formatted for display.

Defaultfalse
rawField?boolean

Name the fields by their id, not by their display name.

Defaultfalse
format?string

The format of the answer.

Default"json"
Value in"json""geojson""csv"
formatOptions?string

Options of the format, as a JSON object.

Response Body

The Records on this page, and how many match.

application/json
  1. response
@meta?

The name and version of the service that answered.

total?integer

How many match, before skip and limit.

data?array<>

The Records.

curl -X GET "https://platform.example.com/api/item/$ITEM_ID/actions/query" \  -H "Authorization: Bearer $TOKEN"
{  "@meta": {},  "total": 0,  "data": [    {}  ]}
POST
/api/item/{id}/actions/query

Authorization

headerAuthorizationBearer <token>

An access token of an OAuth client: Authorization: Bearer <token>.

Path Parameters

id*string

The id of the Item.

Request Body

application/json
  1. body
keyword?string

Words to look for.

query?

A filter, as a JSON object.

select?

The fields to return, as a JSON object of field names to 1 or 0.

skip?integer

How many to skip.

limit?integer

How many to return; 10 when absent.

Default10
sort?

The order, as a JSON object of field names to 1 or -1.

rawValue?boolean

Return the stored values, not the ones formatted for display.

Defaultfalse
rawField?boolean

Name the fields by their id, not by their display name.

Defaultfalse
format?string

The format of the answer.

Default"json"
Value in"json""geojson""csv"
formatOptions?

Options of the format, as a JSON object.

Response Body

The Records on this page, and how many match.

application/json
  1. response
@meta?

The name and version of the service that answered.

total?integer

How many match, before skip and limit.

data?array<>

The Records.

curl -X POST "https://platform.example.com/api/item/$ITEM_ID/actions/query" \  -H "Authorization: Bearer $TOKEN" \  -H "Content-Type: application/json" \  -d '{  "keyword": "string",  "query": {},  "select": {}}'
{  "@meta": {},  "total": 0,  "data": [    {}  ]}