Working with policies via REST
This page describes how to create and delete policies for Document.One (D1) using the Policy Administration API endpoints (which are synchronous).
To create or delete policies in the D1 user interface, see Configuring policies.
Task 1: Creating a Default Type policy
This request creates a Default Type policy matching your specification.
cURL example
You can use the example below as a template for your request.
curl --location --request POST 'D1_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/default-type?sessionId=SESSION_ID' \
--form 'name=POLICY_NAME' \
--form 'defaultTypeName=DEFAULT_TYPE'
Adapt the following properties before executing the request:
SESSION_ID
— Replace with your session ID.POLICY_NAME
— Replace with your policy name.DEFAULT_TYPE
— Replace with the name of the default type to be used by this policy.
OpenAPI
For a code sample, see
Create a Default Type policy by type signature
Endpoint description
HTTP request | Endpoint | Service description | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
POST | D1_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/default-type | Create a Default Type policy. | sessionId | name, defaultTypeName | The metadata of the created policy. |
Parameters
The following table lists the parameters and their descriptions:
Name | Data type | Description |
---|---|---|
sessionId | string | The session ID returned when you authenticate. |
name | string | The name of the created policy. |
defaultType | string | The default type this policy assigns to entries. |
Task 2: Creating an Inheritance policy
This request creates an Inheritance Policy matching your specification.
cURL example
You can use the example below as a template for your request.
curl --location --request POST 'D1_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/inheritance?sessionId=[SESSION_ID]' \
--form 'name=POLICY_NAME' \
--form 'inheritAcl=true' \
--form 'inheritClassification=true' \
--form 'inheritCommonProperties=true' \
--form 'inheritPolicies=true' \
--form 'inheritTags=true'
Adapt the following properties before executing the request:
SESSION_ID
— Replace with your session ID.POLICY_NAME
— Replace with your policy name.- Inheritance properties — Set to
true
orfalse
in accordance with your business needs (all set totrue
by default).
OpenAPI
For a code sample, see
Create an Inheritance policy
Endpoint description
HTTP request | Endpoint | Service description | Endpoint | Request query parameters | Form data |
---|---|---|---|---|---|
POST | D1_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/inheritance | Create an Inheritance policy. | sessionId | name, inheritAcl , inheritClassification , inheritCommonProperties , inheritPolicies , inheritTags | The metadata of the created policy. |
Parameters
The following table lists the parameters and their descriptions:
Name | Data type | Description |
---|---|---|
name | string | The name of the policy. |
inheritAcl | boolean | When set to true , the access control list (ACL) will be inherited from the parent by the entries affected by this policy. |
inheritClassification | boolean | When set to true , the classifications will be inherited from the parent by the entries affected by this policy. |
inheritCommonProperties | boolean | When set to true , the common properties (between the child and the parent) will be inherited from the parent by the entries affected by this policy. |
inheritPolicies | boolean | When set to true , the policies will be inherited from the parent by the entries affected by this policy. |
inheritTags | boolean | When set to true , the tags will be inherited from the parent by the entries affected by this policy. |
Task 3: Creating a Type Restriction policy
This request creates a Type Restriction policy matching your specification.
cURL example
You can use the example below as a template for your request.
curl --location --request POST 'D1_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/type-restriction?sessionId=20201002172057753-956e81a9-094f-4d53-853b-21dd6b4488e2' \
--form 'name=RestrictionPolicy' \
--form 'description=' \
--form 'includeSubTypes=true' \
--form 'restrictedTypeNames
=CustomContent'
Adapt the following properties before executing the request:
SESSION_ID
— Replace with your session ID.- Type restriction properties — Set in accordance with your business needs.
OpenAPI
For a code sample, see
Create a Type Restriction policy by type signatures
Endpoint description
HTTP request | Endpoint | Service description | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
POST | D1_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/type-restriction | Create a Type Restriction policy. | sessionId | name, description , allowedTypeNames , deniedTypeNames , includeSubTypes | The metadata of the created policy. |
Parameters
The following table lists the parameters and their descriptions:
Name | Data type | Description |
---|---|---|
sessionId | string | The session ID returned after authenticating. |
name | string | The name of the policy. |
description | string | The description of the policy. |
allowedTypeNames | array | The array of type names identifying the content/folder types allowed in folders where this policy is in effect. |
deniedTypeNames | array | The array of type names identifying the content/folder types denied from folders where this policy is in effect. |
includeSubTypes | boolean | When set to true , the policy is extended to sub-types. When set to false , only the types explicitly mentioned in allowedTypeNames or deniedTypeNames are affected. |
Task 4: Deleting policies
D1 provides endpoints for deleting a batch of policies as well as for deleting single policies. You can delete policies based on their IDs or based on their technical names.
cURL example
The example below shows how to delete multiple policies by IDs.
curl -X DELETE "[D1_HOST]/tribefire-services/api/v1/access.adx.admin/v1/policies?policyIds=[POLICY_ID_1]&policyIds=[POLICY_ID_2]" -H "accept: application/json"
Replace the following parts of the query:
[D1_HOST]
— Enter your D1 host.[POLICY_ID_1]
,[POLICY_ID_2]
— Enter the policy IDs to identify the policies to be deleted.[SESSION_ID]
— The session ID obtained by authenticating.
OpenAPI
For code samples, see
Delete policies by IDs
Delete policy by ID
Delete policies by IDs
Delete policies by technical names
Delete policy by technical name
Delete policies by technical names
Endpoint description
HTTP request | Endpoint | Service description | Request query parameters | Form data | Returns |
---|---|---|---|---|---|
DELETE | D1_HOST/tribefire-services/api/v1/access.adx.admin/v1/policies | Delete policies by IDs. | sessionId, policyIds | none | The job response quoting the duration of execution. |
DELETE | D1_HOST/tribefire-services/api/v1/access.adx.admin/v1/policies/by-technical-names | Delete policies by technical names. | sessionId, technicalNames (deletes all custom policies if empty!) | none | The job response quoting the duration of execution. |
DELETE | D1_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy | Delete policy by ID. | sessionId, policyId | none | The job response quoting the duration of execution. |
DELETE | D1_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/by-technical-name | Delete policy by technical name. | sessionId, technicalName | none | The job response quoting the duration of execution. |