What conditions need to be met to update a customer record?
In this first example we are going to send a POST request to the REST API to get a response about what conditions need to be met for someone in order to update a customer record.
As a user you can send the request in JSON format for the evaluation and can get 3 distinct response types for the aforementioned request.
Request
To generate an AST response or a JSON response, send the following request to the /authorization/constraints
endpoint.
To generate a Human-readable TEXT response, send this request to the /authorization/simplified-constraints
endpoint.
{
"providedAttributes": [
{
"attribute": "abcbank.documentType",
"values": [
"customer_record"
]
},
{
"attribute": "abcbank.action",
"values": [
"update"
]
}
],
"pdpDecisionSet": [
"PERMIT"
]
}
- AST response
- Human-readable JSON response
- Human-readable TEXT response
AST response
{
"response": {
"apply": {
"function": "or",
"returnType": "boolean",
"arguments": [
{
"apply": {
"function": "and",
"returnType": "boolean",
"arguments": [
{
"apply": {
"function": "not",
"returnType": "boolean",
"arguments": [
{
"apply": {
"function": "anyOf",
"returnType": "boolean",
"arguments": [
{
"functionElement": {
"name": "equal",
"returnType": "boolean"
}
},
{
"constant": {
"value": "employee",
"type": "string"
}
},
{
"attributeDesignator": {
"attributeName": "abcbank.role",
"type": "list",
"listOf": "string"
}
}
]
}
}
]
}
},
{
"apply": {
"function": "anyOf",
"returnType": "boolean",
"arguments": [
{
"functionElement": {
"name": "equal",
"returnType": "boolean"
}
},
{
"constant": {
"value": "investment_banker",
"type": "string"
}
},
{
"attributeDesignator": {
"attributeName": "abcbank.role",
"type": "list",
"listOf": "string"
}
}
]
}
},
{
"apply": {
"function": "anyOf",
"returnType": "boolean",
"arguments": [
{
"functionElement": {
"name": "equal",
"returnType": "boolean"
}
},
{
"constant": {
"value": "office",
"type": "string"
}
},
{
"attributeDesignator": {
"attributeName": "abcbank.location",
"type": "list",
"listOf": "string"
}
}
]
}
}
]
}
},
{
"apply": {
"function": "and",
"returnType": "boolean",
"arguments": [
{
"apply": {
"function": "anyOf",
"returnType": "boolean",
"arguments": [
{
"functionElement": {
"name": "equal",
"returnType": "boolean"
}
},
{
"constant": {
"value": "group_manager",
"type": "string"
}
},
{
"attributeDesignator": {
"attributeName": "abcbank.role",
"type": "list",
"listOf": "string"
}
}
]
}
},
{
"apply": {
"function": "not",
"returnType": "boolean",
"arguments": [
{
"apply": {
"function": "anyOf",
"returnType": "boolean",
"arguments": [
{
"functionElement": {
"name": "equal",
"returnType": "boolean"
}
},
{
"constant": {
"value": "employee",
"type": "string"
}
},
{
"attributeDesignator": {
"attributeName": "abcbank.role",
"type": "list",
"listOf": "string"
}
}
]
}
}
]
}
}
]
}
}
]
}
}
}
Human-readable JSON response
{
"response": "\tnot(\"employee\" == abcbank.role)\tAND\t\"investment_banker\" == abcbank.role\tAND\t\"office\" == abcbank.location\nOR\n\t\"group_manager\" == abcbank.role\tAND\tnot(\"employee\" == abcbank.role)"
}
Human-readable TEXT response
not("employee" == abcbank.role) AND "investment_banker" == abcbank.role AND "office" == abcbank.location
OR
"group_manager" == abcbank.role AND not("employee" == abcbank.role)