JSON PDP API request format
Individual requests
A valid JSON PDP API request is a simple JSON object that can be forwarded to the Policy Decision Service. Policies can match a decision request by Service
, Domain
, Action
, or other attributes.
The following table describes the values contained in a valid JSON PDP API request:
Field | Type | Required | PingAuthorize Trust Framework type | Example value |
---|---|---|---|---|
|
string |
no |
Domain |
|
|
string |
no |
Action |
|
|
string |
no |
Service |
|
|
string |
no |
Identity Provider |
|
|
map<string, string> |
yes |
Other Attributes |
|
Although the |
The following example shows the correct format of a JSON individual decision request:
{
"domain": "Sales.Asia Pacific",
"action": "Retrieve",
"service": "Mobile.Landing page",
"identityProvider": "Social Networks.Spacebook",
"attributes": {
"Prospect name": "B. Vo"
}
}
The following image shows how Prospect name
is defined in the Policy Administration GUI. In this example, the Prospect name attribute has a Request resolver and a Value Settings type of string.
The Trust Framework attribute name must match with the key of the attributes map. For example, if you have an attribute named |
Batch requests
Batch requests consist of an array named "requests"
of JSON objects, each of which is a standard JSON PDP API single decision request.
The following example shows the correct format of a JSON batch decision request:
{
"requests": [
{
"domain": "Sales.Asia Pacific",
"action": "Retrieve",
"service": "Mobile.Landing page",
"identityProvider": "Social Networks.Spacebook",
"attributes": {
"Prospect name": "B. Vo"
}
},
{
"domain": "Sales.EMEA",
"action": "Search",
"service": "Mobile.Users search",
"identityProvider": "Social Networks.Chirper",
"attributes": {
"Prospect name": "A. Mann"
}
}
]
}
Query requests
Query requests consist of the following fields:
-
"query"
: An array containing the following elements:-
"attribute"
: The full name of an unbounded, multivalued, or standard authorization attribute. -
"values"
: An optional array defining the values of the attribute. If you include more than one value in this array, the JSON PDP API treats the attribute as multivalued. If the attribute is unbounded, this array is not required.
-
-
"context"
: A JSON object containing the fields included in a typical individual JSON PDP API request.
The following example shows the correct format of a query decision request:
{
"query": [
{
"attribute": "action"
}
]
"context": {
"domain": "",
"service": "",
"identityProvider":"",
"action":"",
"attributes": {
"User": "{\"id\": 23, \"name\":\"Joe\"}",
"resource": "configuration"
}
}
}
Learn more in Policy queries.