Skip to content

Observations API

Filters

All observation calls can be filtered / sorted with the same ObservationFilter data strcuture.

typescript
interface ObservationsFilter {
  // observation
  // OR - only available for super accounts
  accountIds?: number[];
  // OR
  assessmentIds?: number[];
  // OR
  observationTypes?: string[];
  // used for getting in area: minX, minY, maxX, maxY
  bbox?: [number, number, number, number];
  // defaults to both
  compliant?: boolean;
  // structure, zone0, zone1, zone2, zone3, zone4, access, fire_defense (OR)
  zones?: string[];
  observationProperty?: { key: string; value: string }[];
  observationPropertyExists?: string[];
  observationPropertyNotExists?: string[];

  // media
  hasMedia?: boolean;
  hasDepthData?: boolean;
  hasExtendedMetaData?: boolean;

  // assessment
  assessmentTypeIds?: number[];
  jobCompletedOnOrBefore?: string;
  jobCompletedAfter?: string;
  // defaults to false
  isTest: boolean;

  // assessors
  assessorIds?: number[];

  // if selected will include observation media as a JSON string in the `mediaUrls` property
  includeMedia?: boolean;
  // if provided will only return these keys on objects
  filterKeys?: string[];

  limit?: number;
  offset?: number;
  // asc, desc - default desc
  orderByCreated?: 'asc' | 'desc';
}

Example

This example filter would return no data as there are competing filters, but shows an example of the kind of data that should be given in the body.

json
{
  "accountIds": [1],
  "assessmentIds": [4622, 4590],
  "observationTypes": ["windows", "doors"],
  "bbox": [-122.64979758662376, 38.531732114692864, -122.64979758662374, 38.531732114692866],
  "compliant": true,
  "zones": ["structure", "zone0", "zone1"],
  "observationProperty": [{ "key": "thresholdMaterial", "value": "noThreshold" }],
  "observationPropertyExists": ["thresholdMaterial"],
  "observationPropertyNotExists": ["thresholdMaterial"],
  "hasMedia": true,
  "hasDepthData": true,
  "hasExtendedMetaData": true,
  "assessmentTypeIds": [34],
  "jobCompletedOnOrBefore": "2024-01-01",
  "jobCompletedAfter": "2024-01-01",
  "assessorIds": [1],
  "isTest": true,
  "includeMedia": true,
  "filterKeys": ["id", "assessmentId"]
  "limit": 1,
  "offset": 1,
  "orderByCreated": "asc"
}

Get Types

typescript
/observations/get/types

Get an array of the distinct observation types used given filters.

Returns

json
[
  "windows",
  "doors",
  "accessoryStrucuture",
  ...
]

Get

typescript
/observations/get

Get an array of observation objects given filters.

Returns

json
[
  {
    "id": 123,
    "assessmentId": 53,
    ...
  },
  ...
]

Count

typescript
/observations/count

Get a count of the number of observations that would be returned with the get call.

Returns

json
65034