added

2021-03-30 - Floorplans Schema changes

We are changing the Floorplans response to not nest a Sheets array. Prior to Fieldwire-Version: 2021-03-30, Floorplans entity nested Sheets in the response.

A GET /api/v3/:project_id/floorplans/:floorplan_id looked like:

{
  "id":"floorplan_id",
  "creator_user_id":123456,
  "last_editor_user_id":123456,
  "project_id":"project_id",
  "resolved_conflict":false,
  "created_at":"2021-03-03T22:48:18.061Z",
  "updated_at":"2021-03-03T22:49:12.260Z",
  "device_created_at":"2021-03-03T22:48:18.057Z",
  "device_updated_at":"2021-03-03T22:49:12.217Z",
  "deleted_at":null,
  "name":"Building 1A",
  "is_name_confirmed":true,
  "folder_id":null,
  "is_user_confirmed":true,
  "description":"Floorplan of Building 1A",
  "is_ocr_processing":false,
  "active_sheets_count":1,
  "process_state":null,
  "cascade_deleted_by_id":null,
  "sheets": [
      {
        "original_width":5100,
        "original_height":3300,
        "has_conflicts":false,
        "has_errors":false,
        "tile_size":513,
        "user_id":123456,
        "page_number":1,
        "android_file_width":2048,
        "android_file_height":1325,
        "sheet_upload_id":"sheet_upload_id",
        "suggested_name":"SHEET:Building 1A",
        "version_description":"2021-03-03",
        "version_notes":null,
        "folder_id":null,
        "is_multipage":false,
        "has_low_res_tiles":true,
        "pdf_width":0.8636,
        "pdf_height":0.5588,
        "meters_per_pixel":0.0166812072434608,
        "file_url":"http://www.example.com/file.jpg",
        "thumb_url":"http://www.example.com/thumbnail.jpg",
        "original_url":"http://www.example.com/thumbnail.pdf",
        "android_file_url":"http://www.example.com/android.jpg",
        "name_crop_url":"http://www.example.com/name_crop.png",
        "tiles_package_url":"http://www.example.com/tiles_package.zip"
      }
  ]
}

Now if you set the "Fieldwire-Version" header to 2021-03-30 or after would not nest Sheets

{
  "id":"floorplan_id",
  "creator_user_id":123456,
  "last_editor_user_id":123456,
  "project_id":"project_id",
  "resolved_conflict":false,
  "created_at":"2021-03-03T22:48:18.061Z",
  "updated_at":"2021-03-03T22:49:12.260Z",
  "device_created_at":"2021-03-03T22:48:18.057Z",
  "device_updated_at":"2021-03-03T22:49:12.217Z",
  "deleted_at":null,
  "name":"Building 1A",
  "is_name_confirmed":true,
  "folder_id":null,
  "is_user_confirmed":true,
  "description":"Floorplan of Building 1A",
  "is_ocr_processing":false,
  "active_sheets_count":1,
  "process_state":null,
  "cascade_deleted_by_id":null  
}

This is due to the fact that Sheets could be potentially unbounded within Floorplan. If you still would like to get Sheets nested in Floorplan, see the section below on backward compatibility.

You can still find all Sheets in a Floorplan by calling GET all Sheets by FloorplanID

Affected endpoints

The Floorplan responses in these endpoints are affected.

GET /api/v3/projects/:project_id/floorplans
GET /api/v3/projects/:project_id/floorplans/:floorplan_id
PATCH /api/v3/projects/:project_id/floorplans/:floorplan_id
PUT /api/v3/projects/:project_id/floorplans/:floorplan_id/restore
PUT /api/v3/projects/:project_id/floorplans/:floorplan_id/rotate
POST /api/v3/projects/:project_id/floorplans/sample

Backward Compatibility

You can still get Sheets embeded in Floorplan if you set Fieldwire-Version: to less than 2021-03-30 or call it with a query parameter ?with_current_sheet=true

GET /api/v3/projects/:project_id/floorplans?with_current_sheet=true
GET /api/v3/projects/:project_id/floorplans/:floorplan_id?with_current_sheet=true