Case schema
Being fully driven by configuration, the exact schema of a case's data cannot be included in the documentation as every instance of QuickCase would make use of its own bespoke schema.
Instead, this page focuses on describing how the data of a case is built based on its configuration. This contract is used similarly by both Rest APIs and Webhooks.
Case data
A case's data is the combination of the data for each field of the case.
The case data itself is represented as a JSON object {}
containing key-value pairs for each field of the case.
The type and format of a value for a given field is solely determined by the type of the field.
For example, given a matching definition, the case data could take the following form:
{
"firstName": "John",
"lastName": "Doe",
"email": "support@quickcase.app",
"address": {
"AddressLine1": "XX Some Street",
"PostCode": "AB0 1CD",
"Country": "United Kingdom"
}
}
Case fields
In all the following examples, the key FieldId
can be any valid case field ID, as defined by the case type.
Text
A Text
value is a string
.
{
"FieldId": "Some text"
}
Number
A Number
value can be a number
or string
. Strings should be preferred for floating point precision.
{
"FieldId": "12.34"
}
YesOrNo
A YesOrNo
value is boolean expressed as a case-insensitive string
being either Yes
or No
.
{
"FieldId": "Yes"
}
PhoneUK
A PhoneUK
value is a string
representing a valid UK phone number.
{
"FieldId": "07123456789"
}
Email
A Email
value is a string
representing a valid email address.
{
"FieldId": "test@quickcase.app"
}
Address fields
An Address type field which accepts three types AddressUK
AddressGlobalUK
and AddressGlobal
, and below standard postcode format field values as a string values.
{
"FieldId": {
"AddressLine1": "1A",
"AddressLine2": "2A",
"AddressLine3": "3A",
"PostTown": "London",
"County": "",
"PostCode": "SW1H 9AJ",
"Country": "United Kingdom"
}
}
MoneyGBP
A MoneyGBP
value is a string
representing a monetary value in pence.
For example, £42 would be:
{
"FieldId": "4200"
}
Date
A Date
value is a valid ISO-8601 string
without the time part.
For example, the 29th August 2017 would be:
{
"FieldId": "2017-08-29"
}
DateTime
A DateTime
value is a valid ISO-8601 string
with the Hour Minute Second time part.
For example, the 29th August 2017 09:47:01 AM would be:
{
"FieldId": "2017-08-29T09:45:01.000"
}
TextArea
A TextArea
value is a string
. It can contain \\\\n
to represent line breaks.
{
"FieldId": "Line1\nLine2"
}
FixedList / FixedRadioList
Both FixedList
and FixedRadioList
represent multiple-choice questions with a single answer. Their value is a string
exactly matching the code of one the pre-defined choices for that list.
For example, given a list with options Option1
and Option2
.
{
"FieldId": "Option1"
}
MultiSelectList
A MultiSelectList
represents a multiple-choice questions with multiple answers. The field value is an array
of string
, where each string
item is exactly matching the code of one the pre-defined options for that list.
For example, given a list with options Option1
and Option2
.
{
"FieldId": ["Option1", "Option2"]
}
Complex
A complex value is a JSON object
composed of key-value pairs complying to the complex type contract defined as part of the case type.
For example, given a field FieldId
of complex type WorldAddress
with fields StreetNumber
of type Number
and StreetName
of type Text
:
{
"FieldId": {
"StreetNumber": "42",
"StreetName": "Petty France"
}
}
Same rules applies for the content of a complex type and the content of case data.\ As such, a complex type child field can be a complex type itself:
{
"ComplexField1": {
"SimpleField1": "42",
"ComplexField2": {
"SimpleField2": "Some value"
}
}
}
Collection
A Collection
value is a JSON array
. However, due to data classification constraints, each collection item's value must placed in a value
property of a JSON object
of the following shape:
{
"id": "Optional. Uniquely identifies a collection item. When missing, generated by QuickCase.",
"value": "Actual value of the collection item"
}
This means that the collection array
itself only contains object
s and the actual values are contained within those object
s.
Each collection item will be assigned a unique ID when first created so that it can be uniquely identified. Consequently, id
property should be omitted for new items, but provided for existing items.
Thus, a collection of Text
would initially be created as:
{
"FieldId": [
{
"value": "Value 1"
},
{
"value": "Value 2"
}
]
}
And later updated as:
{
"FieldId": [
{
"id": "db7d76b6-17d6-4aac-9f02-14edaedb5cbb",
"value": "Changing existing item"
},
{
"id": "db7d76b6-17d6-4aac-9f02-12345667899",
"value": "Value 2"
},
{
"value": "New item"
}
]
}
A collection of a complex type would be:
{
"FieldId": [
{
"value": {
"ComplexField1": "Value 1"
}
},
{
"value": {
"ComplexField1": "Value 2"
}
}
]
}
An empty collection would be:
{
"FieldId": []
}
Document
A Document
value is a JSON object
composed of 2 properties:
id
: Unique identifier for the document, as provided by QuickCase's Attachment Storename
: Display name for the document, presented to users as the clickable link to open/download the document.
{
"FieldId": {
"id": "1615555059118198_6670e110-c7af-11eb-8906-eb65e995768a.png",
"name": "aPicture.png"
}
}
CaseLink
A CaseLink
is a field used to reference another case using its universal 16-digit ID. It's a complex type composed of 2 fields:
CaseReference
: Required, the 16-digit reference of the case linkedDescription
: Optional, a label displayed to users instead of the 16-digit reference
{
"FieldId": {
"CaseReference": "1521109509643143",
"Description": "Previous application"
}
}