Update Assessment Observations

Creates, updates, and deletes observations for a given condition assessment. Use the {action} field in the request array item to specify whether the observation is to be created, updated, or deleted. To create or update an observation, specify the observation custom fields in the fields{} request array item. To determine the observation custom fields for the given assessment:

  1. For the requested assessment {id}, get the assessment type.value from Get Condition Assessment
  2. For the assessment type.value, get the custom field metadata identified by attributeName from Get Observations Metadata for Condition Assessment Type.

Resource Information

Scope assessments
App Type Agency
Authorization Type Access token
URI /v4/assessments/{id}/observations?lang={lang}
HTTP Method PUT
Automation Version(s) 9.0.0

Request Information

Field or Parameter Type Required Values Description Automation Version
[] {} Yes   An array containing the observations to be created, updated, or deleted. 9.0.0
id string Yes Get Condition Assessment Observations The unique identifier for the assessment observation. 9.0.0
action string Yes create | update | delete Specifies whether the array item is for a create, update, or delete request. 9.0.0
fields {} Yes Get Observations Metadata for Condition Assessment Type Contains custom field/value pairs comprising an observation. The observation custom fields are defined by the configured observation metadata for the assessment type. The fields{} object is required for all actions; for a delete request, include at least one field. 9.0.0
fields.<customType> string No   A custom field name and value pair. For example in JSON, "My Custom Field": "My Custom Value". The custom field name and its data type are defined in Automation custom forms or custom tables.
  • For a Text field, the maximum length is 256.
  • For a Number field, any numeric form is allowed, including negative numbers.
  • For a Date field, the format is MM/dd/yyyy. For a Time field, the format is hh:mm.
  • For a TextArea field, the maximum length is 4000 characters, and allows line return characters.
  • For a DropdownList field, the dropdown list values are in the options[] array. For a CheckBox field, the (case-sensitive) valid values are "UNCHECKED" and "CHECKED".
  • For a Radio(Y/N) field, the(case-sensitive) valid values are "Yes" and "No".
9.0.0
lang String No   Indicates the language applied. 9.0.0

Example

Sample Request Head

PUT https://apis.accela.com/v4/assessments/1875/observations

Sample Request Body

[
    {
      "id": 1,
      "action": "create",
      "fields": {
        "ModelNumber": "1000",
        "LightType": "low",
        "PACP Code": "101",
        "PACP Joint": "N",
        "PACP Percent": "10",
        "PACP Value 1st": "123"
      }
    },
    {
      "id": 2,
      "action": "update",
      "fields": {
        "ModelNumber": "2200",
        "LightType": "medium",
        "PACP Code": "201",
        "PACP Joint": "Y",
        "PACP Percent": "20",
        "PACP Value 1st": "456"
      }
    },
    {
      "id": 3,
      "action": "delete",
      "fields": {
        "PACP Code": "301"
      }
    }
]

Response Information

Field Type Description Automation Version
result[] result{}   9.0.0
result.code string Any error code encountered during the operation on the requested item. 9.0.0
result.id string The requested observation id. 9.0.0
result.isSuccess boolean Indicates whether or not the operation on the item is successful. 9.0.0
result.message string A text message related to the operation. 9.0.0
status integer The request status. 9.0.0

Example

Sample Response Body

{
  "status": 200,
  "result": [
    {
      "id": 1,
      "isSuccess": true
    },
    {
      "id": 2,
      "isSuccess": true
    },
    {
      "id": 3,
      "isSuccess": true
    }
  ]
}