List Repository Assigned Taxonomy's categories
/content/management/api/v1.1/repositories/{id}/assignedTaxonomies/{taxonomyId}/categories
Request
-
id: string
id of the repository.
-
taxonomyId: string
Id of an assigned taxonomy
-
fields(optional): string
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.
-
limit(optional): integer(int32)
This parameter accepts a non negative integer and is used to control the size of the result.Default Value:
25
-
links(optional): string
This parameter accepts a comma-separated list of link names. By default, this parameter gives all the links applicable. Possible values are: self, canonical, describedby, first, last, prev, next
-
offset(optional): integer(int32)
This parameter accepts a non negative integer and is used to control the start index of the result.Default Value:
0
-
orderBy(optional): string
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
-
q: string
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. -
totalResults(optional): boolean
This parameter accepts a boolean flag. If specified as true, then the returned result must include the total result count.Default Value:
false
Response
- application/json
200 Response
object
-
aggregationResults(optional):
array aggregationResults
Aggregation results.
-
count(optional):
integer(int32)
Total number of records in the current response.
-
hasMore(optional):
boolean
Check whether there are more pages to fetch.
-
items(optional):
array items
Singular resources contained in the collection.
-
limit(optional):
integer(int32)
Actual page size used by the server. This might not be the same as what the client requests.
-
links(optional):
array links
Links of the resource.
-
offset(optional):
integer(int32)
The actual index from which the singular resources are returned.
-
pinned(optional):
array pinned
Pinned items. Shows items pinned at the top of search list
-
scrollId(optional):
string
scrollId if the search resolved to a scroll search.
-
totalResults(optional):
integer(int32)
Total number of rows that satisfy the client request (excluding the paging parameters.)
array
-
Array of:
object AssignedCategory
AssignedCategory
array
-
Array of:
object Link
Link of the resource.
array
object
-
allowedActions(optional):
array allowedActions
The allowed actions of an assigned category. The actions can be "ASSET_CATEGORIZE" and "SITE_CREATE".
-
ancestors(optional):
array ancestors
The ancestors of an assigned category, listing in a top-down order from the root category to the immediate parent category.
-
apiName(optional):
string
The API name of an assigned category.
-
descendantsAllowedActions(optional):
array descendantsAllowedActions
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.
-
description(optional):
string
The description of an assigned category.
-
id(optional):
string
The id of an assigned category.
-
isSiteCategory(optional):
boolean
Whether an assigned category is a site category.
-
links(optional):
array links
The links of an assigned taxonomy resource.
-
name(optional):
string
The name of an assigned category.
-
parent(optional):
object CategoryAncestorBean
-
position(optional):
integer(int32)
The position of an assigned category among its siblings.
array
array
array
array
-
Array of:
object Link
Link of the resource.
object
-
apiName(optional):
string
The apiName of the Category ancestor
-
id(optional):
string
The id of the Category ancestor.
-
name(optional):
string
The name of the Category ancestor.
object
-
href(optional):
string
The target resource's URI. It could be template URI. It is a required property in the get response.
-
mediaType(optional):
string
Media type.
-
method(optional):
string
What HTTP method can be used to access the target resource.
-
profile(optional):
string
Link to the metadata that describes the target resource.
-
rel(optional):
string
Relation type. It is a required property in the get response.
-
templated(optional):
boolean
Whether the URI is a template.
304 Response
400 Response
403 Response
404 Response
500 Response
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" } ] }