Skip to main content

Content validations

Required validations

Required

JSON
1
2
3
4
5
6
7
"validations": { "required": { "message": { "en-GB": "A value is required" } } }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId":"64d3dd41-9c6d-4ecd-a275-628bb4f9bc21", "message":"There are validation errors creating the entry", "data":[ { "field":"fieldId", "message":"A value is required" } ], "type":"Validation" }

MaxLength

JSON
1
2
3
4
5
6
7
8
"validations": { "maxLength": { "value": 50, "message": { "en-GB": "Maximum length of 50" } } }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId":"64d3dd41-9c6d-4ecd-a275-628bb4f9bc21", "message":"There are validation errors creating the entry", "data":[ { "field":"fieldId", "message":"Maximum length of 50" } ], "type":"Validation" }

MinLength

JSON
1
2
3
4
5
6
7
8
"validations": { "minLength": { "value": 10, "message": { "en-GB": "Minimum length of 10" } } }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId":"64d3dd41-9c6d-4ecd-a275-628bb4f9bc21", "message":"There are validation errors creating the entry", "data":[ { "field":"fieldId", "message":"Minimum length of 50" } ], "type":"Validation" }

Min

JSON
1
2
3
4
5
6
7
8
"validations": { "min": { "value": 5, "message": { "en-GB": "The value is too low. A minimum of 5 is required" } } }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId":"64d3dd41-9c6d-4ecd-a275-628bb4f9bc21", "message":"There are validation errors creating the entry", "data":[ { "field":"fieldId", "message":"The value is too low. A minimum of 5 is required" } ], "type":"Validation" }

Max

JSON
1
2
3
4
5
6
7
8
"validations": { "max": { "value": 100, "message": { "en-GB": "The value is too high. A maximum of 100 is allowed" } } }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId":"64d3dd41-9c6d-4ecd-a275-628bb4f9bc21", "message":"There are validation errors creating the entry", "data":[ { "field":"fieldId", "message":"The value is too high. A maximum of 100 is allowed" } ], "type":"Validation" }

Regex

JSON
1
2
3
4
5
6
7
8
"validations": { "regex": { "pattern": "[a-zA-Z]+", "message": { "en-GB": "The value does not match the regex" } } }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId":"64d3dd41-9c6d-4ecd-a275-628bb4f9bc21", "message":"There are validation errors creating the entry", "data":[ { "field":"fieldId", "message":"The value does not match the regex" } ], "type":"Validation" }

AllowedValues

JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"validations": { "allowedValues": { "values": [ { "en-GB": "Red", "fr-FR": "Rouge" }, { "en-GB": "Black", "fr-FR": "Noir" } ], "message": { "en-GB": "The selected value is not allowed", "fr-FR": "La valeur sélectionnée n'est pas autorisée." } } }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId":"64d3dd41-9c6d-4ecd-a275-628bb4f9bc21", "message":"There are validation errors creating the entry", "data":[ { "field":"fieldId", "message":"The selected value is not allowed" } ], "type":"Validation" }

RequiredFields

JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"validations": { "requiredFields": { "fields": [ { "name": "source", "message": { "en-GB": "A source is required" } }, { "name": "quote", "message": { "en-GB": "A quote is required" } }, { "name": "caption", "message": { "en-GB": "An image caption is required" } } ] } }
JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{ "logId":"64d3dd41-9c6d-4ecd-a275-628bb4f9bc21", "message":"There are validation errors creating the entry", "data":[ { "field":"fieldId", "message":"A source is required" }, { "field":"fieldId", "message":"A caption is required" } ], "type":"Validation" }

AllowedFieldTypes

JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
"validations": { "allowedFieldTypes": { "fields": [ { "id": "text", "name": { "en-GB": "Text" }, "description": null, "dataType": "string", "dataFormat": "text", "validations": {} }, { "id": "markup", "name": { "en-GB": "Markup" }, "description": null, "default": null, "dataType": "string", "dataFormat": "html", "validations": {} } ], "message": { "en-GB": "The field type is not allowed" } } }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId":"64d3dd41-9c6d-4ecd-a275-628bb4f9bc21", "message":"There are validation errors creating the entry", "data":[ { "field":"fieldId", "message":"The field type is not allowed" } ], "type":"Validation" }

TaxonomyRoot

JSON
1
2
3
4
5
6
7
8
"validations": { "taxonomyRoot": { "key": "0/1/2", "message": { "en-GB": "The taxonomy code is not in the allowed root" } } }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId":"64d3dd41-9c6d-4ecd-a275-628bb4f9bc21", "message":"There are validation errors creating the entry", "data":[ { "field":"fieldId", "message":"The taxonomy code is not in the allowed root" } ], "type":"Validation" }

AllowedContentTypes

JSON
1
2
3
4
5
6
7
8
9
10
11
"validations": { "allowedContentTypes": { "contentTypes": [ "PDF", "image" ], "message": { "en-GB": "The asset type is not allowed" } } }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId":"64d3dd41-9c6d-4ecd-a275-628bb4f9bc21", "message":"There are validation errors creating the entry", "data":[ { "field":"fieldId", "message":"The asset type is not allowed" } ], "type":"Validation" }

PastDateTime

JSON
1
2
3
4
5
6
7
"validations": { "pastDateTime": { "message": { "en-GB": "The date must be in the past" } } }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId":"64d3dd41-9c6d-4ecd-a275-628bb4f9bc21", "message":"There are validation errors creating the entry", "data":[ { "field":"fieldId", "message":"The date must be in the past" } ], "type":"Validation" }

DecimalPlaces

JSON
1
2
3
4
5
6
7
8
"validations": { "decimalPlaces": { "value": 3, "message": { "en-GB": "The value must be to 3 decimal places" } } }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId":"64d3dd41-9c6d-4ecd-a275-628bb4f9bc21", "message":"There are validation errors creating the entry", "data":[ { "field":"fieldId", "message":"The value must be to 3 decimal places" } ], "type":"Validation" }

MaxCount

JSON
1
2
3
4
5
6
7
8
"validations": { "maxCount": { "value": 3, "message": { "en-GB": "The value cannot contain more than 3 elements" } } }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId":"64d3dd41-9c6d-4ecd-a275-628bb4f9bc21", "message":"There are validation errors creating the entry", "data":[ { "field":"fieldId", "message":"The value cannot contain more than 3 elements" } ], "type":"Validation" }

MinCount

JSON
1
2
3
4
5
6
7
8
"validations": { "minCount": { "value": 3, "message": { "en-GB": "The value cannot contain less than 3 elements" } } }
JSON
1
2
3
4
5
6
7
8
9
10
11
{ "logId":"64d3dd41-9c6d-4ecd-a275-628bb4f9bc21", "message":"There are validation errors creating the entry", "data":[ { "field":"fieldId", "message":"The value cannot contain less than 3 elements" } ], "type":"Validation" }

Still need help?

New support request