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

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

parameters
map<ParameterId, ParameterEvaluationResult>
optional
Show child attributes

Show child attributes

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 } } }