Form Response

A form response is a collection of answers to a form.

The form response model

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the form response.

  • Name
    object
    Type
    string
    Description

    Always 'form_response'.

  • Name
    form
    Type
    string
    Description

    Form this is a response to.

  • Name
    form_version
    Type
    string
    Description

    Form version this is a response to.

  • Name
    patient
    Type
    string
    Description

    Patient this form response is for.

  • Name
    sections
    Type
    array of strings
    Description

    All the sections in the form response.

  • Name
    score
    Type
    number
    Description

    Total score of the form response.

  • Name
    status_history
    Type
    array of objects
    Description
    Status history of the form_response.
  • Name
    created_by
    Type
    string
    Description

    Creator of the form response.

  • Name
    created_at
    Type
    number
    Description

    Timestamp (in ISO 8601 format) of when the form response was created.

  • Name
    last_updated_at
    Type
    number
    Description

    Timestamp (in ISO 8601 format) of when the form response was last updated.

Response

{
    "id": "fres_2UxtAULYUrX7GVsTKePy",
    "object": "form_response",

    "form": "form_NOIYLBGOBNhSwTWCUzfu",
    "form_version": "fver_1JtjV1QEY84Fv395Hl7h",

    "patient": "user_Z1zXZKvqrpwxbznuW6lJ",
    "sections": ["frsc_ap0jVVAdR23DgkQPpdX8"],
    "score": 10,

    "status_history": [
        {
        "status": "inProgress",
        "changed_by": "user_Z1zXZKvqrpwxbznuW6lJ",
        "changed_at": 1653798303
        }
    ],

    "created_by": "user_xeDpGyt67wTor93qKtS7",
    "created_at": 1653798303000,
    "last_updated_at": 1653798303000
}


POST/v2/form_responses

Create a form response

Creates a new form response.

Required attributes

  • Name
    form
    Type
    string
    Description

    Form this is a response to.

  • Name
    patient
    Type
    string
    Description

    Patient this form response is for.

Optional attributes

    Response

     {
        "id": "fres_2UxtAULYUrX7GVsTKePy",
        "object": "form_response",
    
        "form": "form_NOIYLBGOBNhSwTWCUzfu",
        "form_version": "fver_1JtjV1QEY84Fv395Hl7h",
    
        "patient": "user_Z1zXZKvqrpwxbznuW6lJ",
        "sections": ["frsc_ap0jVVAdR23DgkQPpdX8"],
        "score": 10,
    
        "status_history": [
            {
            "status": "inProgress",
            "changed_by": "user_Z1zXZKvqrpwxbznuW6lJ",
            "changed_at": 1653798303
            }
        ],
    
        "created_by": "user_xeDpGyt67wTor93qKtS7",
        "created_at": 1653798303000,
        "last_updated_at": 1653798303000
    }
    
    

    GET/v2/form_responses/:id

    Retrieve a form response

    Retrieves the specified form response.

    Response

    
    {
       "id": "fres_2UxtAULYUrX7GVsTKePy",
       "object": "form_response",
    
       "form": "form_NOIYLBGOBNhSwTWCUzfu",
       "form_version": "fver_1JtjV1QEY84Fv395Hl7h",
    
       "patient": "user_Z1zXZKvqrpwxbznuW6lJ",
       "sections": ["frsc_ap0jVVAdR23DgkQPpdX8"],
       "score": 10,
    
       "status_history": [
         {
           "status": "inProgress",
           "changed_by": "user_Z1zXZKvqrpwxbznuW6lJ",
           "changed_at": 1653798303
         }
       ],
    
       "created_by": "user_xeDpGyt67wTor93qKtS7",
       "created_at": 1653798303000,
       "last_updated_at": 1653798303000
     }
    
    

    POST/v2/form_responses/:id

    Update a form response

    Updates the specified form response object by setting the values of the parameters passed. Any other parameters not provided will not be modified. The form response can only be updated if it's in the 'inProgress' status. If the form response is in status 'completed', no parameters can be updated.

    Required attributes

      Optional attributes

      • Name
        status
        Type
        string
        Description

        Status of the form response.

        Possible values:
        completed

      Response

      
      {
          "id": "fres_2UxtAULYUrX7GVsTKePy",
          "object": "form_response",
      
          "form": "form_NOIYLBGOBNhSwTWCUzfu",
          "form_version": "fver_1JtjV1QEY84Fv395Hl7h",
      
          "patient": "user_Z1zXZKvqrpwxbznuW6lJ",
          "sections": ["frsc_ap0jVVAdR23DgkQPpdX8"],
          "score": 10,
      
          "status_history": [
            {
              "status": "inProgress",
              "changed_by": "user_Z1zXZKvqrpwxbznuW6lJ",
              "changed_at": 1653798303
            }
          ],
      
          "created_by": "user_xeDpGyt67wTor93qKtS7",
          "created_at": 1653798303000,
          "last_updated_at": 1653798303000
        }
      
      

      GET/v2/form_responses

      List all form responses

      Returns a list of all form responses.

      Optional query parameters

      • Name
        form
        Type
        string
        Description

        Form to filter by.

      • Name
        form_version
        Type
        string
        Description

        Form version to filter by.

      • Name
        patient
        Type
        string
        Description

        Patient to filter by.

      Request

      GET
      /v2/form_responses
      curl https://{{base_subdomain}}.avonhealth.com/v2/form_responses?form={{form}}&form_version={{form_version}}&patient={{patient}} \
        -H "Authorization: Bearer {{token}}" \
        -H "x-jwt: {{jwt}}"
      

      Response

      {
        "object": "list",
        "data": [
          {
            "id": "fres_2UxtAULYUrX7GVsTKePy",
            "object": "form_response",
      
            "form": "form_NOIYLBGOBNhSwTWCUzfu",
            "form_version": "fver_1JtjV1QEY84Fv395Hl7h",
      
            "patient": "user_Z1zXZKvqrpwxbznuW6lJ",
            "sections": ["frsc_ap0jVVAdR23DgkQPpdX8"],
            "score": 10,
      
            "status_history": [
              {
                "status": "inProgress",
                "changed_by": "user_Z1zXZKvqrpwxbznuW6lJ",
                "changed_at": 1653798303000
              },
              {
                "status": "completed",
                "changed_by": "user_Z1zXZKvqrpwxbznuW6lJ",
                "changed_at": 1753798303000
              }
            ],
      
            "created_by": "user_xeDpGyt67wTor93qKtS7",
            "created_at": 1653798303000,
            "last_updated_at": 1653798303000
          },
        ]
      }