Validation API
We strongly recommend reviewing Prerequisites for dynamic validation before continuing with this section.
Returns: Input validation parameters.
## Depending on the desired reference parameter, different URI are available.
POST /{tenant}/api/v3/folders/{folder}/services/{service}/validation
POST /{tenant}/api/v3/service/{serviceId}/validation
POST /{tenant}/api/v3/version/{versionId}/validation
POST /{tenant}/api/v3/public/folders/{folder}/services/{service}/validation
POST /{tenant}/api/v3/public/service/{version}/validation
POST /{tenant}/api/v3/public/version/{versionId}/validationAuthorization
Bearer {token}accessible from Authorization - Bearer token or systematically via Client Credentials.The request headers should include a key for
Authorizationwith the valueBearer {token}.
API key created from Authorization - API keys.
The request headers should include the keys
x-synthetic-keyandx-tenant-namewith the values of the API key and tenant name respectively.
No Authorization is required for Authorization - Public APIs.
Path parameters
environment *
Environment is part of your Log in to Spark URL.
tenant *
Tenant is part of your Log in to Spark URL and also available in the User menu.
folder *
Folder associated with the request.
service *
Service associated with the request.
serviceId *
service_id of the requested service. The latest service version will be referenced.
versionId *
version_id of the requested service version.
Request body
Content-Type: application/json
Follows from Execute API (v3) Request body.
There is one additional parameter in the Execute API that controls whether the static or dynamic validations are returned. When a service is uploaded to Spark, the validations based upon the default values are saved into a validation file. This eliminates the need for Spark to process the validations on every single API call.
request_meta.validation_type
default_values returns the pre-processed validations that are static or dynamic (see below for more information). If no parameter is provided, the default_values will be returned.
dynamic returns the updated validations for the validations identified as dynamic based upon the request_data. This only returns the validations that are different than those stored in the validation file.
Response body
Content-Type: application/json
Follows from Execute API (v3) Response body. For each input the API will also return the properties of the validation as an output.
validation_type
dynamic the definition of the validation in this cell changes depending on another input.
This is not the exactly same as a validation that contains formulas, e.g. if a validation range is linked to static numbers, it would not be considered as
dynamic.
static validation in this cell does not depend on another input.
dependent_inputs
List of input fields that would be impacted by this particular validation. For example, if Age and Gender are used to determine the Products that can be offered, then for the validation of Age and Gender, Products would be included as a dependent input.
null if no dependent inputs.
validation_allow
Relates to Excel Data Validation allow format types, e.g. Decimal, List, Date.
ignore_blank
Shows TRUE or FALSE depending on the value of the Excel Data Validation Ignore blank checkbox.
Excel Ignore blank is an unusual feature. When this is FALSE it does not mean the value entered of the cell cannot be blank.
min
Minimum value for an input, null if no min validation.
If this is a dynamic validation field, this will store the initial validation based upon the default values.
max
Maximum value for a numeric input, null if no max validation.
If this is a dynamic validation field, this will store the initial validation based upon the default values.
options
Enumerated list of the validations, null if no enumerated validation.
If this is a dynamic validation field, this will store the initial validation based upon the default values.
Sample file
In this example, the choice of 01_letter from list_a affects the valid list of 02_number from list_b. Note that the choice of default values are important when defining the workbook.

To use this example file you will need to do the following:
Upload this service to Spark.
Call the API externally, for example using Postman.
Modify the API URI following a valid URI. In most cases, modifying the existing endpoint URI from
/executeto/validationshould work.
validation_type static
validation_type staticSample request
Empty
request_dataandrequest_metato extract thedefault_valuesvalidation.
Sample response
01_numberisvalidation_typestatic.02_numberisvalidation_typedynamic.02_numberis adependent_inputof01_letter.
validation_type dynamic part 1
validation_type dynamic part 1Please also reference Prerequisites for dynamic validation.
Sample request
Set
01_lettertobandvalidation_typetodynamic.
Sample response
The updated validation for
02_numberis returned.Note the response has an error because no value for
02_numberwas submitted.Therefore the default value in the spreadsheet of
02_number=1was used which led to a validation error.
validation_type dynamic part 2
validation_type dynamic part 2Sample request
Set
01_lettertoband02_numberto23andvalidation_typetodynamic.
Sample response
The updated validation for
02_numberis returned without errors.
Last updated
