logoBack to home screen

Working with Policies with ADx REST API

This page provides insight on working with Policy Administration endpoints, used to create and delete policies for ADx. Policy Administration API is synchronous

Creating Default Type Policy

This request created a Default Type policy matching your specification.

cURL Example

You can use the example below as a template for your request. 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
curl --location --request POST 'ADX_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/default-type?sessionId=SESSION_ID' \
--form 'name=POLICY_NAME' \
--form 'defaultTypeName=DEFAULT_TYPE'

Endpoint Description

Request typeService descriptionEndpointRequest query parametersForm dataReturns
POSTCreate Default Type PolicyADX_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/default-typesessionIdname, defaultTypeNameMetadata of the created policy

Parameters

ParameterData typeDescription
sessionIdstringSession ID returned when you authenticate
namestringCreated policy name
defaultTypestringDefault type this policy assigns to entries

Creating 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. 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 or false in accordance with your business needs (all set to true by default)
curl --location --request POST 'ADX_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'

Endpoint Description

Request typeService descriptionEndpointRequest query parametersForm dataReturns
POSTCreate Inheritance PolicyADX_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/inheritancesessionIdname, inheritAcl, inheritClassification, inheritCommonProperties, inheritPolicies, inheritTagsMetadata of the created policy

Parameters

ParameterData typeDescription
namestringPolicy name
inheritAclbooleanWhen true, ACL will be inherited from parent by entries affected by this policy
inheritClassificationbooleanWhen true, classifications will be inherited from parent by entries affected by this policy
inheritCommonPropertiesbooleanWhen true, common properties (between the child and the parent) will be inherited from parent by entries affected by this policy
inheritPoliciesbooleanWhen true, policies will be inherited from parent by entries affected by this policy
inheritTagsbooleanWhen true, tags will be inherited from parent by entries affected by this policy

Creating 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. Adapt the following properties before executing the request:

curl --location --request POST 'ADX_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'

Endpoint Description

Request typeService descriptionEndpointRequest query parametersForm dataReturns
POSTCreate Type Restriction PolicyADX_HOST/tribefire-services/api/v1/access.adx.admin/v1/policy/type-restrictionsessionIdname, description, allowedTypeNames, deniedTypeNames, includeSubTypesMetadata of the created policy

Parameters

ParameterData typeDescription
sessionIdstringSession ID returned after authenticating
name,stringPolicy name
description,stringPolicy description
allowedTypeNames,arrayArray of type names identifying the content/folder types allowed in folders where this policy is in effect
deniedTypeNamesarrayArray of type names identifying the content/folder types denied from folders where this policy is in effect
includeSubTypesbooleanWhen true, the policy is extended to sub-types. When false, only the types explicitly mentioned in allowedTypeNames or deniedTypeNames are affected.

Deleting Policies

cURL Example

The example below shows how to delete multiple policies by IDs. Replace the following parts of the query:

  • [ADX_HOST] - enter your ADx host
  • [POLICY_ID_1], [POLICY_ID_2] - enter policy IDs to identify the policies to be deleted
  • [SESSION_ID] - session ID obtained by authenticating
curl -X DELETE "[ADX_HOST]/tribefire-services/api/v1/access.adx.admin/v1/policies?policyIds=[POLICY_ID_1]&policyIds=[POLICY_ID_2]" -H "accept: application/json"

Note that deleting by technical names is also possible. ADx provides endpoints for deleting a batch of policies (as in the example above) as well as for deleting single policies (check the endpoint descriptions below).

Endpoints

Request typeService descriptionEndpointRequest query parametersForm dataReturns
DELETEDelete Policies By Ids​ADX_HOST/tribefire-services/api/v1/access.adx.admin​/v1​/policiessessionId, policyIdsnoneJob response quoting the duration of execution
DELETEDelete Policies By Technical NamesADX_HOST/tribefire-services/api/v1/access.adx.admin​/v1​/policies​/by-technical-namessessionId, technicalNames (deletes all custom policies if empty!)noneJob response quoting the duration of execution
DELETEDelete Policy By IdADX_HOST/tribefire-services/api/v1/access.adx.admin​/v1​/policysessionId, policyIdnoneJob response quoting the duration of execution
DELETEDelete Policy By Technical NameADX_HOST/tribefire-services/api/v1/access.adx.admin​/v1​/policy​/by-technical-namesessionId, technicalNamenoneJob response quoting the duration of execution

UI Equivalent

These operations can also be done in ADx UI. For details, check Configuring Policies.