HomeGuidesSamplesAPI
API

Add notes to inspection questions

Guide on how to add notes to inspection questions

Adding notes using PUT /audits/{audit_id}

To attach notes to inspection questions, the following items must be included in the PUT request body:

  • the question id (item_id)
  • the question type (type)
  • the answer object (responses)

📘

When adding a note, it's important to keep the original response. Otherwise, the answer will be removed.

These are PUT body examples for different question types:

DateTime

{
    "items": [
        {
            "type": "datetime",
            "item_id": "f3245d42-ea77-11e1-aff1-0800200c9a66",
            "responses": {
                "note": "example note",
                "datetime": "2024-04-01T22:38:09.634Z"
            }
        }
    ]
}

TextSingle

{
    "items": [
        {
            "type": "textsingle",
            "item_id": "f3245d43-ea77-11e1-aff1-0800200c9a66",
            "responses": {
                "note": "example note",
                "text": "abc"
            }
        }
    ]
}

Text

{
    "items": [
        {
            "type": "text",
            "item_id": "249b64e4-7dd3-465d-a0e2-191caf4b009e",
            "responses": {
                "note": "example note",
                "text": "long text"
            }
        }
    ]
}

Address

{
    "items": [
        {
            "type": "address",
            "item_id": "f3245d44-ea77-11e1-aff1-0800200c9a66",
            "responses": {
                "note": "example note",
                "location_text": "145 Corben St, Redfern NSW 2008, Australia\n(-34.384637623657284, 153.21293790779057)",               
                "location": {
                    "name": "",
                    "country": "Australia",
                    "geometry": {
                    "type": "Point",
                    "coordinates": [
                        153.21293790779057,
                        -34.384637623657284
                    ]
                },
                "locality": "Redfern",
                "postal_code": "2008",
                "sub_locality": "",
                "thoroughfare": "Corben Street",
                "iso_country_code": "AU",
                "sub_thoroughfare": "145",
                "administrative_area": "NSW",
                "sub_administrative_area": "City of Sydney"
                }
            }
        }
    ]
}

Question

{
    "items": [
        {
            "type": "question",
            "item_id": "6e81a509-8dab-4b09-9423-0be86bc13136",
            "responses": {
                "note": "example note",
                "selected": [
                    {
                        "id": "060ace00-1f61-468e-9c42-918fa93badcf"
                    }
                ],
                "failed": false
            }
        }
    ]
}

Slider

{
    "items": [
        {
            "type": "slider",
            "item_id": "09a26f1d-a0b4-485d-afbf-90c5374f8899",
            "responses": {
                "note": "example note",
                "value": 7
            }
        }
    ]
}