Client Extensions Write API Documentation

This documentation provides comprehensive guidance for writing (POSTing) ClientDTO.Extensions data to the AlayaCare Residential API. The Extensions property allows you to submit dynamic form field data for a client, supporting various field types and answer formats.

POST Body Structure

Sample POST Body for ClientDTO.Extensions
[
  {
    "formFieldLinkID": 288,
    "fieldName": "Boolean-FF",
    "recordState": 1,
    "field": {
      "carePlanMode": 2,
      "fieldID": 298,
      "fieldName": "Boolean-FF",
      "version": "v1.0",
      "versionMajor": 1,
      "versionMinor": 0,
      "type": 300,
      "subType": 600,
      "caption": "Boolean-FF",
      "validationType": 2,
      "formFieldLinkID": 288,
      "formSectionID": 43,
      "formSectionName": "General",
      "sortOrder": 33,
      "formSectionSortOrder": 1,
      "formSortOrder": 1256,
      "isPartialData": false,
      "hasAnswer": false,
      "hasChanged": false,
      "isVisible": true,
      "isReadOnly": false,
      "checkedValue": "Yes",
      "isValidForParameters": false,
      "uncheckedValue": "No",
      "layout": {
        "size": 4,
        "sizeValue": 4,
        "startNewRow": false
      },
      "selectedFocus": "",
      "selectedGoal": "",
      "carePlanItemName": "",
      "deployedParentForms": [],
      "recordState": 1,
      "created": {
        "dateUtc": "2025-07-21T02:00:07.29Z",
        "userName": "Administrator, System (SA) - System Administrator"
      },
      "lastUpdated": {
        "dateUtc": "2025-07-22T01:43:31.0533333Z",
        "userName": "Administrator, System (SA) - System Administrator"
      },
      "answer": true
    }
  },
  {
    "formFieldLinkID": 289,
    "fieldName": "Choice-FF",
    "recordState": 1,
    "field": {
      "codeTableFilterType": 1,
      "carePlanMode": 2,
      "fieldID": 299,
      "fieldName": "Choice-FF",
      "version": "v1.0",
      "versionMajor": 1,
      "versionMinor": 0,
      "type": 500,
      "subType": 500,
      "caption": "Choice-FF",
      "choices": [
        { "formFieldChoiceID": 452, "fieldID": 299, "choiceName": "choice 1", "caption": "choice 1", "defaultType": 1, "exceptionType": 1, "sortOrder": 1, "extraInformationType": 1, "props": [], "recordState": 1, "isPartialData": false, "created": { "dateUtc": "2025-07-21T02:00:59.28Z", "userName": "Administrator, System (SA) - System Administrator" }, "lastUpdated": { "dateUtc": "2025-07-21T02:00:59.28Z", "userName": "Administrator, System (SA) - System Administrator" }, "summary": "choice 1" },
        { "formFieldChoiceID": 453, "fieldID": 299, "choiceName": "Choice2", "caption": "Choice2", "defaultType": 1, "exceptionType": 1, "sortOrder": 2, "extraInformationType": 1, "props": [], "recordState": 1, "isPartialData": false, "created": { "dateUtc": "2025-07-21T02:01:25.8833333Z", "userName": "Administrator, System (SA) - System Administrator" }, "lastUpdated": { "dateUtc": "2025-07-21T02:01:25.8833333Z", "userName": "Administrator, System (SA) - System Administrator" }, "summary": "Choice2" }
      ],
      "formFieldLinkID": 289,
      "formSectionID": 43,
      "formSectionName": "General",
      "sortOrder": 33,
      "formSectionSortOrder": 1,
      "formSortOrder": 1256,
      "isPartialData": false,
      "hasAnswer": false,
      "hasChanged": false,
      "answer": { "k": 452, "v": "choice 1" },
      "isVisible": true,
      "defaultValue": {},
      "isReadOnly": false,
      "max": 100,
      "isValidForParameters": false,
      "source": 2,
      "layout": { "size": 4, "sizeValue": 4, "startNewRow": false },
      "choiceLayout": 2,
      "isFreeForm": false,
      "selectedFocus": "",
      "sourcePropertyName": "Caption",
      "selectedGoal": "",
      "carePlanItemName": "",
      "deployedParentForms": [],
      "recordState": 1,
      "created": { "dateUtc": "2025-07-21T02:00:59.28Z", "userName": "Administrator, System (SA) - System Administrator" },
      "lastUpdated": { "dateUtc": "2025-07-21T02:00:59.28Z", "userName": "Administrator, System (SA) - System Administrator" }
    }
  },
  // ... (other extension objects as in your sample)
]
Replace or extend this array with your own extension objects as needed for your POST request.

Supported Field Types

Important: For all form fields, if validationType is set to Required (i.e., "validationType": 2), the answer (or answers for multiple choice fields) property is mandatory and must be provided. Omitting this property for required fields will result in a validation error.
Type SubType Field Type Answer Property Answer DataType
100100Text Boxanswerstring
100101Text Areaanswerstring
101100String with Expiryanswerobject
200200Numericanswernumber
201200Numeric Rangeanswerobject
300600Booleananswerboolean
400400Dateanswerstring
400402DateTimeanswerstring
400403Timeanswerstring
401400Date Rangeanswerobject
401402DateTime Rangeanswerobject
401403Time Rangeanswerobject
500500Choice Dropdownanswerobject
500501Radio Buttonanswerobject
600500Multiple Dropdownanswersarray
600600Checkboxesanswersarray
Text Box (Type: 100, SubType: 100)
Text Area (Type: 100, SubType: 101)
field": {
  "type": 100,
  "subType": 100, (for TextArea "subType": 101),
  "validationType": 2,
  "answer": "Sample string value",
  "isReadOnly": false,
  "max": 100
  ...
}
  • Answer Format: Direct string value in answer.
  • Validations:
    • answer must be a non-empty string if the validationType property is defined and equal to Required.
    • If validationType is undefined or set to None, answer is not mandatory.
    • answer field should have a maximum length based on max field property.
    • May be read-only depending on isReadOnly field property.
    • May be subject to custom validation scripts if validationType is Script.
String with Expiry (Type: 101, SubType: 100)
"field": {
  "type": 101,
  "subType": 100,
  "validationType": 2,
  "answer": {
    "value": "License123",
    "expiryYear": 2025,
    "expiryMonth": 8
  },
  ...
}
  • Answer Format: Object with value, expiry month, and year in answer
  • Validations:
    • answer must be present if validationType property is defined and equal to Required.
    • If validationType is undefined or set to None, answer is not mandatory.
    • answer must be an object with value (string), expiryYear (number), and expiryMonth (1-12).
    • expiryMonth must be 1-12, expiryYear must be a valid year.
    • All fields must be present if required.
    • May be subject to custom validation scripts if validationType is Script.
Numeric Fields
Numeric Input (Type: 200, SubType: 200)
"field": {
  "type": 200,
  "subType": 200,
  "validationType": 2,
  "max": 5000,
  "min": 500,
  "isIntegerOnly": true,
  "answer": 42,
  ...
}
  • Answer Format: Numeric value in answer
  • Validations:
    • answer must be present if validationType is Required.
    • If validationType is undefined or set to None, answer is not mandatory.
    • Value(s) must be within allowed min and max range if defined.
    • If isIntegerOnly is true, only integers are allowed else decimals are permitted.
    • May be subject to custom validation scripts if validationType is Script.
Numeric Range (Type: 201, SubType: 200)
"field": {
  "type": 201,
  "subType": 200,
  "validationType": 2,
  "maxStart": 10,
  "maxStop": 1000,
  "minStart": 5,
  "minStop": 900,
  "isIntegerOnly": true,
  "answer": {
    "start": 10,
    "stop": 20
  },
  ...
}
  • Answer Format: Object with start and stop values in answer.
  • Validations:
    • answer (both start and stop) must be present if validationType is Required.
    • If validationType is undefined or set to None, answer is not mandatory.
    • answer must be an object with start and stop (numbers).
    • start must be less than or equal to stop.
    • If minStart, maxStart, minStop, or maxStop are present in the field definition, then:
      • start must be between minStart and maxStart (inclusive).
      • stop must be between minStop and maxStop (inclusive).
    • If isIntegerOnly is true, only integers are allowed else decimals are permitted.
    • May be subject to custom validation scripts if validationType is Script.
Example: If minStart=5, maxStart=15, minStop=10, maxStop=25, then valid values are 5 ≤ start ≤ 15 and 10 ≤ stop ≤ 25.
Boolean Fields (Type: 300, SubType: 600)
"field": {
  "type": 300,
  "subType": 600,
  "validationType": 2,
  "answer": true,
  ...
}
  • Answer Format: Boolean value in answer.
  • Validations:
    • answer must be present if validationType is Required.
    • If validationType is undefined or set to None, answer is not mandatory.
    • Only true or false allowed.
Date/Time Fields (Type: 400)
Date (Type: 400, SubType: 400)
"field": {
  "type": 400,
  "subType": 400,
  "validationType": 1,
  "answer": "2025-07-25T00:00:00",
  ...
}
  • Answer Format: ISO datetime string in answer with zero time component.
  • Validations:
    • answer must be present if validationType is Required.
    • If validationType is undefined or set to None, answer is not mandatory.
    • answer must be valid ISO 8601 date/time strings.
    • answer must not include a non-zero time component. The time part is only allowed if it is exactly T00:00:00.
DateTime (Type: 400, SubType: 402)
"field": {
  "type": 400,
  "subType": 402,
  "validationType": 2,
  "answer": "2025-07-22T18:00:00",
  ...
}
  • Answer Format: ISO datetime string in answer.
  • Validations:
    • answer must be present if validationType is Required.
    • If validationType is undefined or set to None, answer is not mandatory.
    • answer must be valid ISO 8601 date/time strings.
Time (Type: 400, SubType: 403)
"field": {
  "type": 400,
  "subType": 403,
  "validationType": 1,
  "answer": "13:30:00",
  ...
}
  • Answer Format: ISO time string in answer.
  • Validations:
    • answer must be present if validationType is Required.
    • If validationType is undefined or set to None, answer is not mandatory.
    • answer must be valid ISO 8601 time strings in 24-hour format (HH:mm:ss).
Date/Time Range Fields (Type: 401)
Date Range (Type: 401, SubType: 400)
"field": {
  "type": 401,
  "subType": 400,
  "validationType": 2,
  "answer": {
    "start": "2025-07-20T00:00:00",
    "stop": "2025-07-25T00:00:00"
  },
  ...
}
  • Answer Format: Object with start and stop date strings in answer.
  • Validations:
    • answer must be present if validationType is Required.
    • If validationType is undefined or set to None, answer is not mandatory.
    • answer must be an object with start and stop (ISO 8601 date strings).
    • Both start and stop dates must not include a non-zero time component. The time part is only allowed if it is exactly T00:00:00.
    • start must be before or equal to stop.
DateTime Range (Type: 401, SubType: 402)
"field": {
  "type": 401,
  "subType": 402,
  "validationType": 1,
  "answer": {
    "start": "2025-07-15T16:00:00",
    "stop": "2025-07-17T18:00:00"
  },
  ...
}
  • Answer Format: Object with start and stop datetime strings in answer.
  • Validations:
    • answer must be present if validationType is Required.
    • If validationType is undefined or set to None, answer is not mandatory.
    • answer must be an object with start and stop (ISO 8601 date strings).
    • Both start and stop dates must include a time component.
    • start must be before or equal to stop.
Time Range (Type: 401, SubType: 403)
⚠️ Important: Please contact AlayaCare team if you need to use this field type.
Single Choice Fields (Type: 500)
Choice Dropdown (Type: 500, SubType: 500)
Radio Button (Type: 500, SubType: 501)
"field": {
  "type": 500,
  "subType": 500,
  "validationType": 2,
  "source": 2,
  "answer": {
    "k": 564,
    "v": "Business",
  },
  ...
}
  • Answer Format: Object with key (k) and value (v) in answer.
  • Validations:
    • answer must be present if validationType is Required.
    • If validationType is undefined or set to None, answer is not mandatory.
    • answer must be a valid object with both k and v present and non-empty.
    • When source = 1 (choiceFormFieldChoiceType : CodeTable)
      • "answer": {
            "k": entryID property of the code table entry,
            "v": value property of the code table entry
        }
    • When source = 2 (choiceFormFieldChoiceType : FormFieldChoice)
      • "answer": {
            "k": formFieldChoiceID property of the choice,
            "v": caption property of the choice
        }
  • Datasource: How to get choices for choice-based fields
  • Business Rules:
    • Only one choice allowed.
Multiple Choice Fields (Type: 600)
⚠️ Important: Multiple choice fields use the answers property instead of answer
Multiple Dropdown (Type: 600, SubType: 500)
Checkboxes (Type: 600, SubType: 600)
"field": {
  "type": 600,
  "subType": 500,
  "validationType": 2,
  "answers": [
    {"k": 461, "v": "choice 1"},
    {"k": 462, "v": "Is Vegan"}
  ],
  ...
}
  • Answer Format: Array of objects with key (k) and value (v) in answers.
  • Validations:
    • If validationType is Required, answers must be a non-empty array of valid objects (each with k and v).
    • If no validationType is set or is None, answers array may be empty if no choices selected.
    • When source = 1 (choiceFormFieldChoiceType : CodeTable)
      • "answers": [{
            "k": entryID property of the code table entry,
            "v": value property of the code table entry
        },
        {
            "k": entryID property of the code table entry,
            "v": value property of the code table entry
        }...]
    • When source = 2 (choiceFormFieldChoiceType : FormFieldChoice)
      • "answers": [{
            "k": formFieldChoiceID property of the choice,
            "v": caption property of the choice
        },
        {
            "k": formFieldChoiceID property of the choice,
            "v": caption property of the choice
        }...]
  • Datasource: How to get choices for choice-based fields
  • Business Rules:
    • May allow multiple or no selections.

Enum Reference

The following enums are referenced throughout the form field definitions:

ChoiceFormFieldChoiceType

Defines the data source type for choice-based fields:

ChoiceFormFieldChoiceType
{
    CodeTable = 1,
    Custom = 2,
    SQL = 3
}
  • CodeTable (1): Choices are retrieved from code tables using CodeTableEntriesService
  • Custom (2): Choices are defined directly in the form field configuration
  • SQL (3): Choices are retrieved via SQL query (not currently supported in UI)
FormFieldValidationType

Defines validation requirements for form fields:

FormFieldValidationType
{
    None = 1,
    Required = 2,
    Script = 3
}
  • None (1): No validation required - field is optional
  • Required (2): Field must have a value - validation will fail if empty
  • Script (3): Custom validation script determines validity

How to Get Choices for Choice-Based Fields

For fields using source = choiceFormFieldChoiceType (such as Choice Dropdown, Radio Button, Multiple Dropdown, and Checkboxes), the available choices are determined by the source property and are retrieved as follows:

  • CodeTable (source = 1): Use {{BaseUrl}}/Setup/CodeTableEntry?includePayload=false&tableID={{tableID}} where the tableID query parameter is the codeTableID property in the field body (refer to the example below)
    
    "field": {
      "fieldName": "Choice-FF",
      "type": 500,
      "subType": 501,
      "validationType": 2,
      "source": 1,
      "codeTableID": 1100,
      "answer": {
        "k": 455,
        "v": "choice 1"
      },
      ...
    }
    
  • Custom (source = 2): Choices are provided directly in the field.choices property of the form field definition.
                                              
    "field": {
      "fieldName": "Choice-FF",
      "type": 500,
      "subType": 500,
      "choices": [
        {
          "formFieldChoiceID": 452,
          "choiceName": "choice 1",
          "caption": "choice 1",
          ...
        },
        {
          "formFieldChoiceID": 453,
          "choiceName": "Choice2",
          "caption": "Choice2",
          ...
        }
      ],
      "source": 2,
      ...
    } 
                                              
  • SQL (source = 3): N/A

AlayaCare Resi API Documentation