Retrieve Policy

Retrieves policies or policy types.

The Policy Management APIs provide an abstracted layer on top of entity extraction, categorization, and related functionality to allow the definition of policies for the management of information. Classifications can be created to group documents and other objects into collections. Policies enact actions upon documents associated with a collection such as indexing.

Classification involves sorting documents into Collections; all documents in a collection share some common criteria, identified using Conditions.

The collection or collections that a document matches can influence how it is indexed and determine policies that are executed against it.

The Retrieve Policy API allows policy objects to be retrieved.

Quick Start

Using this API you can retrieve policy objects.

For example:

/1/api/[async|sync]/retrievepolicyobjects/v1?id=3&type=policy

The following policy object types can be retrieved:

  • policy. A policy is of a specific type and defines how documents should be treated.
  • policy_type. A definition of a policy type.

Start and max_page_results can be used to specify the first object and the number of objects to return.

The additional parameter takes a JSON object specifying additional parameters that can be provided. For example:

{
    "include_deleted": true
}

Include_deleted indicates whether the response should include information on deleted policies.

Objects of type policy are returned in the following format:

{
    "id": 3,
    "name": "Policy 1",
    "description": "Description for policy 1 ",
    "type": "policy",
    "additional": {
        "policy_type_id": 1,
        "priority": 0,
        "details": {
            "fieldActions": [
                {
                    "action": "ADD_FIELD_VALUE",
                    "name": "FLAGGED",
                    "value": "TRUE"
                }
            ],
            "idolIndexAction": "FULL"
        },
        "is_deleted": false
    }
}

Objects of type policy_type are returned in the following format:

{
    "id": 7,
    "name": "Policy Type 1",
    "description": "Description for policy type 1 ",
    "type": "policy_type",
    "additional": {
        "definition": {
            "title": "Indexing Policy Type",
            "description": "An indexing policy.",
            "type": "object",
            "properties": {
                "idolIndexAction": {
                    "enum": [
                        "FULL",
                        "NONE"
                    ],
                    "type": "string"
                },
                "fieldActions": {
                    "items": {
                        "properties": {
                            "action": {
                                "description": "The type of action to perform on the field.",
                                "enum": [
                                    "ADD_FIELD_VALUE"
                                ],
                                "type": "string"
                            },
                            "name": {
                                "description": "The name of the field to perform the action on.",
                                "minLength": 1,
                                "type": "string"
                            },
                            "value": {
                                "description": "The value to use for the field action.",
                                "type": "string"
                            }
                        },
                        "required": [
                            "name",
                            "action"
                        ],
                        "title": "Field Action",
                        "type": "object"
                    },
                    "type": "array"
                }
            },
            "required": [
                "idolIndexAction"
            ],
            "short_name": "index"
        }
    }
}
Synchronous
https://api.havenondemand.com/1/api/sync/retrievepolicyobjects/v1
Asynchronous
https://api.havenondemand.com/1/api/async/retrievepolicyobjects/v1
Authentication

This API requires an authentication token to be supplied in the following parameter:

Parameter Description
apikey The API key to use to authenticate the API request.
Parameters

This API accepts the following parameters:

Required
Name Type Description
type
enum The type of policy object to retrieve.
Optional
Name Type Description
additional
json JSON-formatted additional information depending on the object type. See the schema for more details
id
array<number> The IDs of the policy object to retrieve.
max_page_results
number The maximum number of results to return. If you have set the start parameter, max_page_results sets the maximum number of results to return from the total results set. Default value: 10.
start
number The number of the first object to retrieve. Default value: 1.
Enumeration Types

This API's parameters use the enumerations described below:

type
The type of policy object to retrieve.
policy Policy
A policy object of type policy.
policy_type Policy Type
A policy object of type policy_type.

This API returns a JSON response that is described by the model below. This single model is presented both as an easy to read abstract definition and as the formal JSON schema.

Asynchronous Use

Additional requests are required to get the result if this API is invoked asynchronously.

You can use /1/job/status/<job-id> to get the status of the job, including results if the job is finished.

You can also use /1/job/result/<job-id>, which waits until the job has finished and then returns the result.

Model
This is an abstract definition of the response that describes each of the properties that might be returned.
Retrieve Policy Response {
results ( array[Results] )
totalhits ( number , optional) The total number of policy objects of this type.
}
Retrieve Policy Response:Results {
One of the following: Policy or Policy_type
additional ( , optional) JSON-formatted additional information depending on the object type.
description ( , optional) The description of the policy object.
id ( number ) The ID of the policy object.
name ( , optional) The name of the policy object.
type ( enum<Type> ) The type of the policy object.
}
enum<Retrieve Policy Response:Results:Type> {
'policy' , 'policy_type'
}
Policy {
additional ( Additional )
description ( , optional) The description of the policy.
id ( number , optional) The ID of the policy object.
name ( string ) The name of the policy.
type ( enum<Type> , optional)
}
enum<Policy:Type> {
'policy'
}
Policy:Additional {
details ( object ) The details of the policy.
policy_type_id ( number ) The ID of the policy_type.
priority ( number ) The priority of the policy.
}
Policy_type {
additional ( Additional )
description ( , optional) The description of the policy_type.
id ( number ) The ID of the policy type object.
name ( string ) The name of the policy_type.
type ( enum<Type> , optional)
}
enum<Policy_type:Type> {
'policy_type'
}
Policy_type:Additional {
definition ( object ) The additional parameters for the policy_type.
short_name ( string ) The short name for the policy type.
}
Model Schema
This is a JSON schema that describes the syntax of the response. See json-schema.org for a complete reference.
{
    "definitions": {
        "policy": {
            "properties": {
                "additional": {
                    "properties": {
                        "details": {
                            "type": "object"
                        },
                        "policy_type_id": {
                            "multipleOf": 1,
                            "type": "number"
                        },
                        "priority": {
                            "multipleOf": 1,
                            "type": "number"
                        }
                    },
                    "required": [
                        "id",
                        "policy_type_id",
                        "priority",
                        "details"
                    ],
                    "type": "object"
                },
                "id": {
                    "multipleOf": 1,
                    "type": "number"
                },
                "name": {
                    "type": "string"
                },
                "type": {
                    "enum": [
                        "policy"
                    ]
                }
            },
            "required": [
                "name",
                "additional"
            ],
            "type": "object"
        },
        "policy_type": {
            "properties": {
                "additional": {
                    "properties": {
                        "definition": {
                            "type": "object"
                        },
                        "short_name": {
                            "type": "string"
                        }
                    },
                    "required": [
                        "short_name",
                        "definition"
                    ],
                    "type": "object"
                },
                "id": {
                    "multipleOf": 1,
                    "type": "number"
                },
                "name": {
                    "type": "string"
                },
                "type": {
                    "enum": [
                        "policy_type"
                    ]
                }
            },
            "required": [
                "id",
                "name",
                "additional"
            ],
            "type": "object"
        }
    },
    "properties": {
        "results": {
            "items": {
                "oneOf": [
                    {
                        "$ref": "#/definitions/policy"
                    },
                    {
                        "$ref": "#/definitions/policy_type"
                    }
                ],
                "properties": {
                    "additional": {
                        "type": [
                            "object",
                            "null"
                        ]
                    },
                    "id": {
                        "multipleOf": 1,
                        "type": "number"
                    },
                    "name": {
                        "minLength": 1,
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "type": {
                        "enum": [
                            "policy",
                            "policy_type"
                        ]
                    }
                },
                "required": [
                    "id",
                    "type"
                ],
                "type": "object"
            },
            "type": "array"
        },
        "totalhits": {
            "multipleOf": 1,
            "type": "number"
        }
    },
    "required": [
        "results"
    ],
    "type": "object"
}


If you would like to provide us with more information then please use the box below:

We will use your submission to help improve our product.