List Repository Assigned Taxonomy's categories

get

/content/management/api/v1.1/repositories/{id}/assignedTaxonomies/{taxonomyId}/categories

List categories of an assigned taxonomy under a repository.

Request

Path Parameters
Query Parameters
  • This parameter is used to control the returned fields in each assigned category in the list. This parameter accepts a comma-separated list of field names. These fields will be returned for assigned category in the list. All the field names are case-sensitive, and users must provide the correct field names in the query. Each assigned category can have these fields: id, name, description, apiName, position, isSiteCategory, parent, ancestors, allowedActions, descendantsAllowedActions. This parameter is optional. If it is not present, the default fields would be returned in the response: id, name, description. Any incorrect or invalid field name given in the parameter will throw an error.

    Example: ?fields=id,name,apiName,ancestors,allowedActions,descendantsAllowedActions
    This returns id, name, apiName, ancestors, allowedActions, and descendantsAllowedActions fields for each assigned category.
  • This parameter accepts a non negative integer and is used to control the size of the result.
    Default Value: 25
  • This parameter accepts a non negative integer and is used to control the start index of the result.
    Default Value: 0
  • This parameter is used to control order of results. The value of this query parameter follow the format of fieldName:[asc/desc]. asc stands for ascending order, desc stands for descending order, default order is asc.The only fields allowed in the field name are name and position. The default value of this parameter is name:asc.
    Default Value: name:asc
  • This parameter accepts a query expression condition that matches the field values. Query conditions can be joined using AND, OR, and NOT logical operators and grouped with parentheses. A query condition with unary operator follows the format of {fieldName} {unary operator}. A query condition with binary operator follows the format of {fieldName} {binary operator} "{fieldValue}". The only field names allowed are parent, parent.id, name, allowedActions, and descendantsAllowedActions. A query cannot include multiple conditions with same named fields. It is required to have one and only one condition about parent category via parent or parent.id field or have one condition on category name via name field.
    The only allowed operator is pr (Present) for parent and the logical operator NOT must be applied to the parent pr condition.
    The only allowed operator is eq (Equals) for parent.id.
    The only allowed operator is co (Contains) for name and its value is case insensitive.
    The only allowed operator is eq (Equals) for allowedActions and the allowed values are either "ASSET_CATEGORIZE" or "SITE_CREATE".
    The only allowed operator is eq (Equals) for descendantsAllowedActions and the allowed values are either "ASSET_CATEGORIZE" or "SITE_CREATE".

    Example:
    ?q=(NOT parent pr) AND (allowedActions eq "SITE_CREATE" OR descendantsAllowedActions eq "SITE_CREATE")
    This query filters top level categories of an assigned taxonomy to return categories that the user has Create Site permission on the category or on any descendant of the category.

    Example:
    ?q=(parent.id eq "2E0C45CF1C1147F590448FC355437149") AND (allowedActions eq "ASSET_CATEGORIZE" OR descendantsAllowedActions eq "ASSET_CATEGORIZE")
    This query filters child categories under the category with id "2E0C45CF1C1147F590448FC355437149" of an assigned taxonomy to return categories that the user has Categorize permission on the category or on any descendant of the category.

    Example:
    ?q=(name co "org") AND (allowedActions eq "ASSET_CATEGORIZE")
    This query filters categories of an assigned taxonomy to return those whose name contain "org" case insensitively and on which the user has Categorize permission.
  • This parameter accepts a boolean flag. If specified as true, then the returned result must include the total result count.
    Default Value: false
Back to Top

Response

Supported Media Types

200 Response

OK.
Body ()
Root Schema : AssignedCategories
Type: object
AssignedCategories
Show Source
Nested Schema : aggregationResults
Type: array
Aggregation results.
Show Source
Nested Schema : items
Type: array
Singular resources contained in the collection.
Show Source
Nested Schema : pinned
Type: array
Pinned items. Shows items pinned at the top of search list
Show Source
Nested Schema : AggregationResult
Type: object
Show Source
Nested Schema : AssignedCategory
Type: object
AssignedCategory
Show Source
Nested Schema : allowedActions
Type: array
The allowed actions of an assigned category. The actions can be "ASSET_CATEGORIZE" and "SITE_CREATE".
Show Source
Nested Schema : ancestors
Type: array
The ancestors of an assigned category, listing in a top-down order from the root category to the immediate parent category.
Show Source
Nested Schema : descendantsAllowedActions
Type: array
The aggregated allowed actions of the descendants of an assigned category. The actions can be "ASSET_CATEGORIZE" and "SITE_CREATE". If the category has no child, the actions would be an empty array.
Show Source
Nested Schema : CategoryAncestorBean
Type: object
Show Source

304 Response

Not modified.

400 Response

Bad request.

403 Response

Forbidden.

404 Response

Not found.

500 Response

Internal server error.
Back to Top

Examples

The following example shows how to list categories of an assigned taxonomy under a repository by submitting a GET request using cURL.

curl -X GET -H 'Accept: application/json' 'https://host:port/content/management/api/v1.1/repositories/{id}/assignedTaxonomies/{taxonomyId}/categories'

Example 1:

This lists top level categories of taxonomy FB8240D6DC70407F87ED111325D06F89 that is assigned to the repository 720E2B7391E64FB9A1EB5FA6DEA8F4C7, where user has ASSET_CATEGORIZE permission on the categories or on their descendants, sorted by category position ascending.

/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories?offset=0&limit=10&orderBy=position:asc&fields=id,name,description,apiName,position,isSiteCategory,parent,ancestors,allowedActions,descendantsAllowedActions&totalResults=true&q=(NOT parent pr) AND (allowedActions eq \"ASSET_CATEGORIZE\" OR descendantsAllowedActions eq \"ASSET_CATEGORIZE\")

Response Body

{
  "hasMore": false,
  "offset": 0,
  "count": 2,
  "limit": 2,
  "totalResults": 2,
  "items": [
    {
      "id": "03C2AB780DDD442CAC90328A0CA6687E",
      "name": "Region East",
      "apiName": "org-r",
      "position": 0,
      "isSiteCategory": false,
      "ancestors": [],
      "allowedActions": [],
      "descendantsAllowedActions": [
        "ASSET_CATEGORIZE",
        "SITE_CREATE"
      ],
      "links": [
        {
          "href": "http://{hostname}/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories/03C2AB780DDD442CAC90328A0CA6687E",
          "rel": "self",
          "method": "GET",
          "mediaType": "application/json"
        }
      ]
    },
    {
      "id": "13C36CDABB764F1C866DF233F7F7DB4A",
      "name": "Region West",
      "apiName": "org-r1",
      "position": 1,
      "isSiteCategory": false,
      "ancestors": [],
      "allowedActions": [
        "ASSET_CATEGORIZE"
      ],
      "descendantsAllowedActions": [],
      "links": [
        {
          "href": "http://{hostname}/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories/13C36CDABB764F1C866DF233F7F7DB4A",
          "rel": "self",
          "method": "GET",
          "mediaType": "application/json"
        }
      ]
    }
  ],
  "links": [
    {
      "href": "http://{hostname}/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories?q=(NOT parent pr) AND (allowedActions eq \"ASSET_CATEGORIZE\" OR descendantsAllowedActions eq \"ASSET_CATEGORIZE\")&totalResults=true&offset=0&limit=10&orderBy=position:asc&fields=id,name,description,apiName,position,isSiteCategory,parent,ancestors,allowedActions,descendantsAllowedActions",
      "rel": "self",
      "method": "GET",
      "mediaType": "application/json"
    },
    {
      "href": "http://{hostname}/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories?q=(NOT parent pr) AND (allowedActions eq \"ASSET_CATEGORIZE\" OR descendantsAllowedActions eq \"ASSET_CATEGORIZE\")&totalResults=true&offset=0&limit=10&orderBy=position:asc&fields=id,name,description,apiName,position,isSiteCategory,parent,ancestors,allowedActions,descendantsAllowedActions",
      "rel": "canonical",
      "method": "GET",
      "mediaType": "application/json"
    },
    {
      "href": "http://{hostname}/content/management/api/v1.1/metadata-catalog/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories",
      "rel": "describedby",
      "method": "GET",
      "mediaType": "application/json"
    },
    {
      "href": "http://{hostname}/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories?q=(NOT parent pr) AND (allowedActions eq \"ASSET_CATEGORIZE\" OR descendantsAllowedActions eq \"ASSET_CATEGORIZE\")&totalResults=true&offset=0&limit=10&orderBy=position:asc&fields=id,name,description,apiName,position,isSiteCategory,parent,ancestors,allowedActions,descendantsAllowedActions",
      "rel": "first",
      "method": "GET",
      "mediaType": "application/json"
    },
    {
      "href": "http://{hostname}/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories?q=(NOT parent pr) AND (allowedActions eq \"ASSET_CATEGORIZE\" OR descendantsAllowedActions eq \"ASSET_CATEGORIZE\")&totalResults=true&offset=0&limit=10&orderBy=position:asc&fields=id,name,description,apiName,position,isSiteCategory,parent,ancestors,allowedActions,descendantsAllowedActions",
      "rel": "last",
      "method": "GET",
      "mediaType": "application/json"
    }
  ]
}

Example 2:

This lists categories under parent category 03C2AB780DDD442CAC90328A0CA6687E of taxonomy FB8240D6DC70407F87ED111325D06F89 that is assigned to the repository 720E2B7391E64FB9A1EB5FA6DEA8F4C7, where user has ASSET_CATEGORIZE permission on the categories or on their descendants, sorted by category position ascending.

/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories?offset=0&limit=10&orderBy=position:asc&fields=id,name,description,apiName,position,isSiteCategory,parent,ancestors,allowedActions,descendantsAllowedActions&totalResults=true&q=(parent.id eq \"03C2AB780DDD442CAC90328A0CA6687E\") AND (allowedActions eq \"ASSET_CATEGORIZE\" OR descendantsAllowedActions eq \"ASSET_CATEGORIZE\")

Response Body

{
  "hasMore": false,
  "offset": 0,
  "count": 1,
  "limit": 1,
  "totalResults": 1,
  "items": [
    {
      "id": "8A34CF67453E4BDE94505476C03B1066",
      "name": "IT East",
      "apiName": "org-r-i",
      "position": 2,
      "isSiteCategory": false,
      "parent": {
        "id": "03C2AB780DDD442CAC90328A0CA6687E",
        "name": "Region East",
        "apiName": "org-r"
      },
      "ancestors": [
        {
          "id": "03C2AB780DDD442CAC90328A0CA6687E",
          "name": "Region East",
          "apiName": "org-r"
        }
      ],
      "allowedActions": [
        "ASSET_CATEGORIZE",
        "SITE_CREATE"
      ],
      "descendantsAllowedActions": [],
      "links": [
        {
          "href": "http://{hostname}/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories/8A34CF67453E4BDE94505476C03B1066",
          "rel": "self",
          "method": "GET",
          "mediaType": "application/json"
        }
      ]
    }
  ],
  "links": [
    {
      "href": "http://{hostname}/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories?q=(parent.id eq \"03C2AB780DDD442CAC90328A0CA6687E\") AND (allowedActions eq \"ASSET_CATEGORIZE\" OR descendantsAllowedActions eq \"ASSET_CATEGORIZE\")&totalResults=true&offset=0&limit=10&orderBy=position:asc&fields=id,name,description,apiName,position,isSiteCategory,parent,ancestors,allowedActions,descendantsAllowedActions",
      "rel": "self",
      "method": "GET",
      "mediaType": "application/json"
    },
    {
      "href": "http://{hostname}/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories?q=(parent.id eq \"03C2AB780DDD442CAC90328A0CA6687E\") AND (allowedActions eq \"ASSET_CATEGORIZE\" OR descendantsAllowedActions eq \"ASSET_CATEGORIZE\")&totalResults=true&offset=0&limit=10&orderBy=position:asc&fields=id,name,description,apiName,position,isSiteCategory,parent,ancestors,allowedActions,descendantsAllowedActions",
      "rel": "canonical",
      "method": "GET",
      "mediaType": "application/json"
    },
    {
      "href": "http://{hostname}/content/management/api/v1.1/metadata-catalog/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories",
      "rel": "describedby",
      "method": "GET",
      "mediaType": "application/json"
    },
    {
      "href": "http://{hostname}/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories?q=(parent.id eq \"03C2AB780DDD442CAC90328A0CA6687E\") AND (allowedActions eq \"ASSET_CATEGORIZE\" OR descendantsAllowedActions eq \"ASSET_CATEGORIZE\")&totalResults=true&offset=0&limit=10&orderBy=position:asc&fields=id,name,description,apiName,position,isSiteCategory,parent,ancestors,allowedActions,descendantsAllowedActions",
      "rel": "first",
      "method": "GET",
      "mediaType": "application/json"
    },
    {
      "href": "http://{hostname}/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories?q=(parent.id eq \"03C2AB780DDD442CAC90328A0CA6687E\") AND (allowedActions eq \"ASSET_CATEGORIZE\" OR descendantsAllowedActions eq \"ASSET_CATEGORIZE\")&totalResults=true&offset=0&limit=10&orderBy=position:asc&fields=id,name,description,apiName,position,isSiteCategory,parent,ancestors,allowedActions,descendantsAllowedActions",
      "rel": "last",
      "method": "GET",
      "mediaType": "application/json"
    }
  ]
}

Example 3:

This lists categories of taxonomy FB8240D6DC70407F87ED111325D06F89 that is assigned to the repository 720E2B7391E64FB9A1EB5FA6DEA8F4C7 whose names contain \"east\" case insensitively and the user has SITE_CREATE permission on the categories, sorted by category name ascending.

/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories?offset=0&limit=10&orderBy=name:asc&fields=id,name,description,apiName,position,isSiteCategory,parent,ancestors,allowedActions,descendantsAllowedActions&totalResults=true&q=name co \"east\" AND allowedActions eq \"SITE_CREATE\"

Response Body

{
  "hasMore": false,
  "offset": 0,
  "count": 1,
  "limit": 1,
  "totalResults": 1,
  "items": [
    {
      "id": "8A34CF67453E4BDE94505476C03B1066",
      "name": "IT East",
      "apiName": "org-r-i",
      "position": 2,
      "isSiteCategory": false,
      "parent": {
        "id": "03C2AB780DDD442CAC90328A0CA6687E",
        "name": "Region East",
        "apiName": "org-r"
      },
      "ancestors": [
        {
          "id": "03C2AB780DDD442CAC90328A0CA6687E",
          "name": "Region East",
          "apiName": "org-r"
        }
      ],
      "allowedActions": [
        "ASSET_CATEGORIZE",
        "SITE_CREATE"
      ],
      "descendantsAllowedActions": [],
      "links": [
        {
          "href": "http://{hostname}/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories/8A34CF67453E4BDE94505476C03B1066",
          "rel": "self",
          "method": "GET",
          "mediaType": "application/json"
        }
      ]
    }
  ],
  "links": [
    {
      "href": "http://{hostname}/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories?q=(name co \"east\") AND (allowedActions eq \"SITE_CREATE\")&totalResults=true&offset=0&limit=10&orderBy=name:asc&fields=id,name,description,apiName,position,isSiteCategory,parent,ancestors,allowedActions,descendantsAllowedActions",
      "rel": "self",
      "method": "GET",
      "mediaType": "application/json"
    },
    {
      "href": "http://{hostname}/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories?q=(name co \"east\") AND (allowedActions eq \"SITE_CREATE\")&totalResults=true&offset=0&limit=10&orderBy=name:asc&fields=id,name,description,apiName,position,isSiteCategory,parent,ancestors,allowedActions,descendantsAllowedActions",
      "rel": "canonical",
      "method": "GET",
      "mediaType": "application/json"
    },
    {
      "href": "http://{hostname}/content/management/api/v1.1/metadata-catalog/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories",
      "rel": "describedby",
      "method": "GET",
      "mediaType": "application/json"
    },
    {
      "href": "http://{hostname}/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories?q=(name co \"east\") AND (allowedActions eq \"SITE_CREATE\")&totalResults=true&offset=0&limit=10&orderBy=name:asc&fields=id,name,description,apiName,position,isSiteCategory,parent,ancestors,allowedActions,descendantsAllowedActions",
      "rel": "first",
      "method": "GET",
      "mediaType": "application/json"
    },
    {
      "href": "http://{hostname}/content/management/api/v1.1/repositories/720E2B7391E64FB9A1EB5FA6DEA8F4C7/assignedTaxonomies/FB8240D6DC70407F87ED111325D06F89/categories?q=(name co \"east\") AND (allowedActions eq \"SITE_CREATE\")&totalResults=true&offset=0&limit=10&orderBy=name:asc&fields=id,name,description,apiName,position,isSiteCategory,parent,ancestors,allowedActions,descendantsAllowedActions",
      "rel": "last",
      "method": "GET",
      "mediaType": "application/json"
    }
  ]
}
Back to Top