Skip to content

Assessment Report Data API

Get Assessment Report Data

typescript
/assessment-report-data/get

Returns the assessment report data

Body

json
{
  // the ID of the assessment whose report data is requested
  "id": 123
}

Returns

json
// AssessmentReportDataType
{
  ...
}

Types

typescript
interface AssessmentReportDataType {
  data: DataItem[]
  observationTypesInfo: Record<string, {
    label: string;
    description: string;
    descriptionUrl: string;
  }>
  assessmentDetails: {
    date: string;
    addressLine1: string;
    addressLine2: string;
    addressCity: string;
    addressCounty: string;
    addressPostalCode: string;
    addressState: string;
    addressCountry: string;
    parcelSize: number;
    assessedByName: string;
    assessmentTypeName: string;
    parcelLat: number;
    parcelLon: number;
  }
  // URLs to data
  craftDataPackage: {
    tms: string;
    parcel: string;
    tms_url: string;
    slope_tif: string;
    slope_tms: string;
    fire_events: string;
    parcel_zones: string;
    fire_stations: string;
    structure_buffer: string;
    neighborhood_zones: string;
    neighborhood_parcels: string;
  };
  priorities: {
    id: number;
    key: string;
    label: string;
    description: string;
    link: string;
  }[];
  priorityRisks: any[];
  customTreatments: any[];
  ibhs?: {
    submissionStatusUpdatedOn: DateTimeType,
    designationLevel: 'base' | 'plus'
  }
}

interface Media {
  id: number;
  accountId: number;
  remoteId: string;
  assessmentId: number;
  observationId: number;
  mime: string;
  width: number;
  height: number;
  length: null | number;
  sizeBytes: number;
  url: string;
  thumbnailUrl: string;
  originalUrl: string;
  depthBinaryUrl: null | string;
  synced: number;
  createdOn: string;
  createdBy: number;
  updatedOn: string | null;
  updatedBy: number | null;
  extendedMetaData: string; // JSON
  isDeleted: number;
  gpsLatitude: string | null;
  gpsLongitude: string | null;
  gpsDirection: number | null;
  gpsDirectionRef: string;
  originalCreationDate: string | null;
  fovHorizontalDegrees: number | null;
  fovVerticalDegrees: number | null;
}

// Core Observation Interface
interface Observation {
  id: number;
  accountId: number;
  remoteId: string;
  assessmentId: number;
  createdOn: string;
  createdBy: number;
  updatedOn: string | null;
  updatedBy: number | null;
  lat: string;
  lon: string;
  synced: number;
  syncedOn: null;
  mediaSynced: number;
  mediaSyncedOn: null;
  flag: number;
  type: string;
  compliant: boolean;
  zone: string;
  note: string;
  data: Record<string, any>;
  numObservations: number;
  status: 'active' | string;
  reportPublicComment: null | string;
  reportCustomTreatment: number;
  referenceImageBbox: null | string;
  aiReferenceImageId: null | number;
  sceneImageId: null | number;
  createdUsingAi: number;
  latLonBoundingBox: null | string;
  media: Media[];
}

interface Treatment {
  text: {
    en: string;
    [languageCode: string]: string;
  }
}

interface NiceField {
  label: string;
  value: string;
  field: string;
  compliant: boolean;
}

// Main Data Item Interface
interface DataItem {
  observation: Observation;
  label: string;
  treatments: {
    GOOD: Treatment[];
    BETTER: Treatment[];
    BEST: Treatment[];
  }
  treatmentFields: string[];
  treatmentGroup: string;
  niceFields: NiceField[];
  warnings: any[];
  priority: number;
  visualId: string;
}