added

2021-04-15 - TemplateCheckList Schema change

We are changing the TemplateCheckList response to not nest a TemplateCheckItem array. Prior to Fieldwire-Version: 2021-04-15, TemplateCheckList entity nested TemplateCheckItems in the response.

423

A TemplateCheckList

A GET /api/v3/:project_id/template_checklist/:template_checklist looked like:

{
  "id":"3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "creator_user_id":0,
  "last_editor_user_id":0,
  "project_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name":"Electrical Walkthrough",
  "created_at":"2021-04-27T17:21:40.127Z",
  "deleted_at":"2021-04-27T17:21:40.127Z",
  "device_created_at":"2021-04-27T17:21:40.127Z",
  "device_updated_at":"2021-04-27T17:21:40.127Z",
  "updated_at":"2021-04-27T17:21:40.127Z",
  "resolved_conflict":true,
  "template_check_items":[
    {
      "id":"3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "template_checklist_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "name":"Power is on",
      "created_at":"2021-04-27T17:21:40.127Z",
      "device_created_at":"2021-04-27T17:21:40.127Z",
      "device_updated_at":"2021-04-27T17:21:40.127Z",
      "updated_at":"2021-04-27T17:21:40.127Z",
      "resolved_conflict":true,
      "project_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6",
      "deleted_at":"2021-04-27T17:21:40.127Z"
    }
  ]
}

Now if you set the "Fieldwire-Version" header to 2021-04-15 or after would not nest TemplateCheckItems.

{
  "id":"3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "creator_user_id":0,
  "last_editor_user_id":0,
  "project_id":"3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "name":"Electrical Walkthrough",
  "created_at":"2021-04-27T17:21:40.127Z",
  "deleted_at":"2021-04-27T17:21:40.127Z",
  "device_created_at":"2021-04-27T17:21:40.127Z",
  "device_updated_at":"2021-04-27T17:21:40.127Z",
  "updated_at":"2021-04-27T17:21:40.127Z",
  "resolved_conflict":true
}

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

Affected Endpoints

The TemplateCheckList responses in these endpoints are affected.

Get all TemplateCheckList in a Project
Get a TemplateCheckList by ID
Response back from creating a TemplateCheckList
Response back from updating a TemplateCheckList

GET /api/v3/projects/:project_id/template_checklists
GET /api/v3/projects/:project_id/template_checklists/:template_checklist_id
POST /api/v3/projects/:project_id/template_checklists
PATCH /api/v3/projects/:project_id/template_checklists/:template_checklist_id

Backward Compatibility

You can still get TemplateCheckItems embeded in TemplateCheckList if you set Fieldwire-Version: to less than 2021-04-15.