Search documentation
karat

+

K

User Documentation ↗

Validate Action

POST/api/v1/ontologies/{ontologyRid}/actions/{actionType}/validate

Validates if an action can be run with the given set of parameters. The response contains the evaluation of parameters and submission criteria that determine if the request is VALID or INVALID. For performance reasons, validations will not consider existing objects or other data in Foundry. For example, the uniqueness of a primary key or the existence of a user ID will not be checked. Note that parameter default values are not currently supported by this endpoint. Unspecified parameters will be given a default value of null.

Third-party applications using this endpoint via OAuth2 must request the following operation scopes: api:ontologies-read.

Path parameters

ontologyRid
string

The unique Resource Identifier (RID) of the Ontology that contains the action. To look up your Ontology RID, please use the List ontologies endpoint or check the Ontology Manager.

actionType
string

The API name of the action to validate. To find the API name for your action, use the List action types endpoint or check the Ontology Manager.

Request body

ValidateActionRequest
object
Hide child attributes

Hide child attributes

parameters
map<ParameterId, DataValue>
optional
Show child attributes

Show child attributes

ParameterId
string

The unique identifier of the parameter. Parameters are used as inputs when an action or query is applied. Parameters can be viewed and managed in the Ontology Manager.

DataValue
any

Represents the value of data in the following format. Note that these values can be nested, for example an array of structs.

TypeJSON encodingExample
Arrayarray["alpha", "bravo", "charlie"]
Attachmentstring"ri.attachments.main.attachment.2f944bae-5851-4204-8615-920c969a9f2e"
Booleanbooleantrue
Bytenumber31
DateISO 8601 extended local date string"2021-05-01"
Decimalstring"2.718281828"
Floatnumber3.14159265
Doublenumber3.14159265
Integernumber238940
Longstring"58319870951433"
Markingstring"MU"
Nullnullnull
Object Setstring OR the object set definitionri.object-set.main.versioned-object-set.h13274m8-23f5-431c-8aee-a4554157c57z
Ontology Object ReferenceJSON encoding of the object's primary key10033123 or "EMP1234"
Setarray["alpha", "bravo", "charlie"]
Shortnumber8739
Stringstring"Call me Ishmael"
StructJSON object{"name": "John Doe", "age": 42}
TwoDimensionalAggregationJSON object{"groups": [{"key": "alpha", "value": 100}, {"key": "beta", "value": 101}]}
ThreeDimensionalAggregationJSON object{"groups": [{"key": "NYC", "groups": [{"key": "Engineer", "value" : 100}]}]}
TimestampISO 8601 extended offset date-time string in UTC zone"2021-01-04T05:00:00Z"

Response body

ValidateActionResponse
object

Success response.

Hide child attributes

Hide child attributes

result
string (enum)

Represents the state of a validation.

Enum values: VALID, INVALID

submissionCriteria
list<SubmissionCriteriaEvaluation>
optional
Show child attributes

Show child attributes

SubmissionCriteriaEvaluation
object

Contains the status of the submission criteria. Submission criteria are the prerequisites that need to be satisfied before an Action can be applied. These are configured in the Ontology Manager.

Show child attributes

Show child attributes

configuredFailureMessage
string
optional

The message indicating one of the submission criteria was not satisfied. This is configured per submission criteria in the Ontology Manager.

result
string (enum)

Represents the state of a validation.

Enum values: VALID, INVALID

parameters
map<ParameterId, ParameterEvaluationResult>
optional
Show child attributes

Show child attributes

ParameterId
string

The unique identifier of the parameter. Parameters are used as inputs when an action or query is applied. Parameters can be viewed and managed in the Ontology Manager.

ParameterEvaluationResult
object

Represents the validity of a parameter against the configured constraints.

Show child attributes

Show child attributes

result
string (enum)

Represents the state of a validation.

Enum values: VALID, INVALID

evaluatedConstraints
list<ParameterEvaluatedConstraint>
optional
Show child attributes

Show child attributes

ParameterEvaluatedConstraint
union

A constraint that an action parameter value must satisfy in order to be considered valid. Constraints can be configured on action parameters in the Ontology Manager. Applicable constraints are determined dynamically based on parameter inputs. Parameter values are evaluated against the final set of constraints.

The type of the constraint.

TypeDescription
arraySizeThe parameter expects an array of values and the size of the array must fall within the defined range.
groupMemberThe parameter value must be the user id of a member belonging to at least one of the groups defined by the constraint.
objectPropertyValueThe parameter value must be a property value of an object found within an object set.
objectQueryResultThe parameter value must be the primary key of an object found within an object set.
oneOfThe parameter has a manually predefined set of options.
rangeThe parameter value must be within the defined range.
stringLengthThe parameter value must have a length within the defined range.
stringRegexMatchThe parameter value must match a predefined regular expression.
unevaluableThe parameter cannot be evaluated because it depends on another parameter or object set that can't be evaluated. This can happen when a parameter's allowed values are defined by another parameter that is missing or invalid.
Show child attributes

Show child attributes

oneOf
object
optional

The parameter has a manually predefined set of options.

Show child attributes

Show child attributes

options
list<ParameterOption>
optional
Show child attributes

Show child attributes

ParameterOption
object

A possible value for the parameter. This is defined in the Ontology Manager by Actions admins.

Show child attributes

Show child attributes

displayName
string
optional

The display name of the entity.

value
any
optional

An allowed configured value for a parameter within an action.

otherValuesAllowed
boolean

A flag denoting whether custom, user provided values will be considered valid. This is configured via the Allowed "Other" value toggle in the Ontology Manager.

groupMember
object
optional

The parameter value must be the user id of a member belonging to at least one of the groups defined by the constraint.

objectPropertyValue
object
optional

The parameter value must be a property value of an object found within an object set.

range
object
optional

The parameter value must be within the defined range.

Show child attributes

Show child attributes

lt
any
optional

Less than

lte
any
optional

Less than or equal

gt
any
optional

Greater than

gte
any
optional

Greater than or equal

arraySize
object
optional

The parameter expects an array of values and the size of the array must fall within the defined range.

Show child attributes

Show child attributes

lt
any
optional

Less than

lte
any
optional

Less than or equal

gt
any
optional

Greater than

gte
any
optional

Greater than or equal

objectQueryResult
object
optional

The parameter value must be the primary key of an object found within an object set.

stringLength
object
optional

The parameter value must have a length within the defined range. This range is always inclusive.

Show child attributes

Show child attributes

lt
any
optional

Less than

lte
any
optional

Less than or equal

gt
any
optional

Greater than

gte
any
optional

Greater than or equal

stringRegexMatch
object
optional

The parameter value must match a predefined regular expression.

Show child attributes

Show child attributes

regex
string

The regular expression configured in the Ontology Manager.

configuredFailureMessage
string
optional

The message indicating that the regular expression was not matched. This is configured per parameter in the Ontology Manager.

unevaluable
object
optional

The parameter cannot be evaluated because it depends on another parameter or object set that can't be evaluated. This can happen when a parameter's allowed values are defined by another parameter that is missing or invalid.

required
boolean

Represents whether the parameter is a required input to the action.

Examples

Request

Copied!
1 2 3 4 5 curl -X POST \ -H "Content-type: application/json" \ -H "Authorization: Bearer $TOKEN" \ "https://$HOSTNAME/api/v1/ontologies/ri.ontology.main.ontology.c61d9ab5-2919-4127-a0a1-ac64c0ce6367/actions/rename-employee/validate" \ -d '{"parameters":{"id":"2","firstName":"Chuck","lastName":"Jones","age":17,"date":"2021-05-01","numbers":[1,2,3],"hasObjectSet":true,"objectSet":"ri.object-set.main.object-set.39a9f4bd-f77e-45ce-9772-70f25852f623","reference":"Chuck","percentage":41.3,"differentObjectId":"2"}}'

Response

Copied!
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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 { "result": "INVALID", "submissionCriteria": [ { "configuredFailureMessage": "First name can not match the first name of the referenced object.", "result": "INVALID" } ], "parameters": { "age": { "result": "INVALID", "evaluatedConstraints": [ { "type": "range", "gte": 18 } ], "required": true }, "id": { "result": "VALID", "evaluatedConstraints": [], "required": true }, "date": { "result": "VALID", "evaluatedConstraints": [], "required": true }, "lastName": { "result": "VALID", "evaluatedConstraints": [ { "type": "oneOf", "options": [ { "displayName": "Doe", "value": "Doe" }, { "displayName": "Smith", "value": "Smith" }, { "displayName": "Adams", "value": "Adams" }, { "displayName": "Jones", "value": "Jones" } ], "otherValuesAllowed": true } ], "required": true }, "numbers": { "result": "VALID", "evaluatedConstraints": [ { "type": "arraySize", "lte": 4, "gte": 2 } ], "required": true }, "differentObjectId": { "result": "VALID", "evaluatedConstraints": [ { "type": "objectPropertyValue" } ], "required": false }, "firstName": { "result": "VALID", "evaluatedConstraints": [], "required": true }, "reference": { "result": "VALID", "evaluatedConstraints": [ { "type": "objectQueryResult" } ], "required": false }, "percentage": { "result": "VALID", "evaluatedConstraints": [ { "type": "range", "lt": 100, "gte": 0 } ], "required": true }, "objectSet": { "result": "VALID", "evaluatedConstraints": [], "required": true }, "attachment": { "result": "VALID", "evaluatedConstraints": [], "required": false }, "hasObjectSet": { "result": "VALID", "evaluatedConstraints": [], "required": false }, "multipleAttachments": { "result": "VALID", "evaluatedConstraints": [ { "type": "arraySize", "gte": 0 } ], "required": false } } }