Preview a category
get
/content/preview/api/v1.1/taxonomies/{id}/categories/{categoryId}
Returns promoted version of category if taxonomy is published to the specified channel. A category is uniquely identified by an id.
Each category has the following information:
Each category has the following information:
- Standard fields: These are fields created by the system.
- id: ID of the category.
- name: Name of the category.
- description : Description of the category.
- parent: Parent of the category.
- ancestors: Ancestors of the category. Each position in this array represents an ancestor category from first to last position. First category in the array represents the root category and the last category in the array represents the immediate parent of the requested resource.
Request Headers:
Is required | Header Name | Header Value |
---|---|---|
Required | channelToken | {valid channel token value} |
Optional | Accept | application/json |
Request
Path Parameters
-
categoryId: string
Unique identifier (ID) for a category.
-
id: string
Unique identifier (ID) of a taxonomy.
Query Parameters
-
channelToken(optional): string
Channel token of the targeted channel. A channel token must be provided as either a query parameter or a request header.
-
expand(optional): string
Expand parameter provides the option of getting child resources (referenced items) inline with the category's response. Accepts a comma-separated list of field names or all. Field names are case-sensitive. When expand is specified as all (with all in lower case), all the fields of the requested category are expanded. When expand is not specified, the category response contains links to the referenced children. Expansion of this form is supported for one level only. When the expand parameter contains a nonexistent field as per category definition, the resource produces HTTP 400.
Example : expand=children
Returns children categories sorted by their respective position ascending. This sort order cannot be changed in this request.
Example : expand=all
Returns child resources (children) available for this category. Only the first 1000 children categories will be expanded. -
links(optional): string
Accepts a comma-separated list of rel (relation) links, which the client requires in the results. By default, all the applicable links in a resource are included in the response. Possible values are: self, canonical, describedby.
Example: links=self,canonical will only return the links with the rel property self or canonical.
Response
Supported Media Types
- application/json
200 Response
Successful operation.
Root Schema : CategoryInformation
Type:
object
Category Information
Show Source
-
ancestors(optional):
array ancestors
The ancestors of the Category. First element represents the root category and the last element represents the immediate parent of the category.
-
apiName(optional):
string
The apiName of the Category.
-
children(optional):
object CollectionPropertiesCategoryChildBean
CollectionProperties.
-
customProperties(optional):
object customProperties
Additional Properties Allowed: CustomPropertyValuesBeanThe custom properties' values of the Category.
-
description(optional):
string
The description of the Category.
-
id(optional):
string
The id of the Category.
-
keywords(optional):
array keywords
The keywords of the Category.
-
links(optional):
array links
Links
-
name(optional):
string
The name of the Category.
-
parent(optional):
object CategoryAncestorBean
-
position(optional):
integer(int32)
Minimum Value:
0
The position of the Category among its siblings. - relatedCategories(optional): array relatedCategories
-
synonyms(optional):
array synonyms
The synonyms of the Category.
Nested Schema : ancestors
Type:
array
The ancestors of the Category. First element represents the root category and the last element represents the immediate parent of the category.
Show Source
Nested Schema : CollectionPropertiesCategoryChildBean
Type:
object
CollectionProperties.
Show Source
-
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
-
properties(optional):
object properties
Additional Properties Allowed: additionalPropertiesadditional collection properties.
-
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.)
Nested Schema : customProperties
Type:
object
Additional Properties Allowed
Show Source
The custom properties' values of the Category.
Nested Schema : CategoryAncestorBean
Type:
Show Source
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.
Nested Schema : links
Type:
array
Links of the resource.
Show Source
-
Array of:
object Link
Link of the resource.
Nested Schema : pinned
Type:
array
Pinned items. Shows items pinned at the top of search list
Show Source
Nested Schema : properties
Type:
object
Additional Properties Allowed
Show Source
additional collection properties.
Nested Schema : CategoryChildBean
Type:
Show Source
object
-
apiName(optional):
string
The apiName of the child Category.
-
description(optional):
string
The description of the child Category.
-
id(optional):
string
The id of the child Category.
-
links(optional):
array links
Links
-
name(optional):
string
The name of the child Category.
-
position(optional):
integer(int32)
Minimum Value:
0
The position of the child Category among its siblings.
Nested Schema : Link
Type:
object
Link of the resource.
Show Source
-
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.
Nested Schema : additionalProperties
Type:
object
Nested Schema : CustomPropertyValuesBean
Type:
Show Source
object
-
values(optional):
array values
The list of values of the custom property.
Nested Schema : CustomPropertyValue
Type:
Show Source
object
-
id(optional):
string
Read Only:
true
The id of the custom property value. -
value(optional):
string
The value of the custom property.
Nested Schema : RelatedCategory
Type:
object
Related Category
Show Source
-
apiName(optional):
string
The apiName of the category.
-
id(optional):
string
The id of the category.
-
name(optional):
string
The name of the category.
-
nodes(optional):
array nodes
The path of the category.
-
taxonomy(optional):
object RelatedTaxonomyBean
Nested Schema : nodes
Type:
array
The path of the category.
Show Source
-
Array of:
object CategoryNodeItem
CategoryNodeBean
Nested Schema : RelatedTaxonomyBean
Type:
Show Source
object
-
id(optional):
string
The id of the taxonomy.
-
name(optional):
string
The name of the taxonomy.
-
shortName(optional):
string
The short name of the taxonomy.
Nested Schema : CategoryNodeItem
Type:
object
CategoryNodeBean
Show Source
-
apiName(optional):
string
The apiName of the Category node.
-
id(optional):
string
The id of the Category node.
-
name(optional):
string
The name of the Category node.
304 Response
Not changed. The request honors requests with e-tag.
400 Response
Bad Request. The server is unable to process the request on the client side due to malformed syntax, invalid data or message framing.
403 Response
Forbidden. Client is not authorized to perform this request.
404 Response
The requested resource was not found.
500 Response
Internal server error. An unexpected error condition encountered in the system.
Examples
Example 1:
The following example shows how to preview a category published to the specified channel by submission of a GET request on the REST resource using cURL:
curl -X GET -H 'Accept: application/json' 'https://host:port/content/preview/api/v1.1/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/A7F8B29894694105952FBD9AA364C18A?expand=children&channelToken=f25be6ca65a34208a788c16ec58590a9'
This previews published taxonomy's categories within a taxonomy (id: 72773D667DF247DF836C78F1C1F5B198) with category (id: A7F8B29894694105952FBD9AA364C18A) and children expanded in a channel (channelToken:f25be6ca65a34208a788c16ec58590a9).
Response Body
{ "id": "A7F8B29894694105952FBD9AA364C18A", "name": "car red", "description": "car red description", "apiName": "te3-c-c", "position": 0, "parent": { "id": "7519DE99BA3E47DF911E7200F31AFE19", "name": "car", "apiName": "te3-c" }, "ancestors": [ { "id": "7519DE99BA3E47DF911E7200F31AFE19", "name": "car", "apiName": "te3-c" } ], "children": { "hasMore": false, "offset": 0, "count": 3, "limit": 100, "items": [ { "id": "8E01EC77F66840BDB397C30661E6118D", "name": "car red small", "description": "car red small description", "apiName": "te3-c-c-c", "position": 0, "links": [ { "href": "https://<hostname>/content/preview/api/v1.1/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/8E01EC77F66840BDB397C30661E6118D?channelToken=f25be6ca65a34208a788c16ec58590a9", "rel": "self", "method": "GET", "mediaType": "application/json" }, { "href": "https://<hostname>/content/preview/api/v1.1/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/8E01EC77F66840BDB397C30661E6118D?channelToken=f25be6ca65a34208a788c16ec58590a9", "rel": "canonical", "method": "GET", "mediaType": "application/json" }, { "href": "https://<hostname>/content/preview/api/v1.1/metadata-catalog/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/8E01EC77F66840BDB397C30661E6118D?channelToken=f25be6ca65a34208a788c16ec58590a9", "rel": "describedby", "method": "GET", "mediaType": "application/schema+json" } ] }, { "id": "7E28B160661449EAA4017AD662701799", "name": "car red medium", "description": "car red medium description", "apiName": "te3-c-c-c1", "position": 1, "links": [ { "href": "https://<hostname>/content/preview/api/v1.1/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/7E28B160661449EAA4017AD662701799?channelToken=f25be6ca65a34208a788c16ec58590a9", "rel": "self", "method": "GET", "mediaType": "application/json" }, { "href": "https://<hostname>/content/preview/api/v1.1/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/7E28B160661449EAA4017AD662701799?channelToken=f25be6ca65a34208a788c16ec58590a9", "rel": "canonical", "method": "GET", "mediaType": "application/json" }, { "href": "https://<hostname>/content/preview/api/v1.1/metadata-catalog/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/7E28B160661449EAA4017AD662701799?channelToken=f25be6ca65a34208a788c16ec58590a9", "rel": "describedby", "method": "GET", "mediaType": "application/schema+json" } ] }, { "id": "D2E8B8A1A71040ACA45A5113A2BF3B8A", "name": "car red large", "description": "car red large description", "apiName": "te3-c-c-c2", "position": 2, "links": [ { "href": "https://<hostname>/content/preview/api/v1.1/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/D2E8B8A1A71040ACA45A5113A2BF3B8A?channelToken=f25be6ca65a34208a788c16ec58590a9", "rel": "self", "method": "GET", "mediaType": "application/json" }, { "href": "https://<hostname>/content/preview/api/v1.1/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/D2E8B8A1A71040ACA45A5113A2BF3B8A?channelToken=f25be6ca65a34208a788c16ec58590a9", "rel": "canonical", "method": "GET", "mediaType": "application/json" }, { "href": "https://<hostname>/content/preview/api/v1.1/metadata-catalog/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/D2E8B8A1A71040ACA45A5113A2BF3B8A?channelToken=f25be6ca65a34208a788c16ec58590a9", "rel": "describedby", "method": "GET", "mediaType": "application/schema+json" } ] } ], "links": [ { "href": "https://<hostname>/content/preview/api/v1.1/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/A7F8B29894694105952FBD9AA364C18A?expand=children&channelToken=f25be6ca65a34208a788c16ec58590a9", "rel": "child", "method": "GET", "mediaType": "application/json" } ] }, "links": [ { "href": "https://<hostname>/content/preview/api/v1.1/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/A7F8B29894694105952FBD9AA364C18A?channelToken=f25be6ca65a34208a788c16ec58590a9&expand=all", "rel": "self", "method": "GET", "mediaType": "application/json" }, { "href": "https://<hostname>/content/preview/api/v1.1/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/A7F8B29894694105952FBD9AA364C18A?channelToken=f25be6ca65a34208a788c16ec58590a9&expand=all", "rel": "canonical", "method": "GET", "mediaType": "application/json" }, { "href": "https://<hostname>/content/preview/api/v1.1/metadata-catalog/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/A7F8B29894694105952FBD9AA364C18A?channelToken=f25be6ca65a34208a788c16ec58590a9", "rel": "describedby", "method": "GET", "mediaType": "application/schema+json" } ] }
Example 2:
curl -X GET -H 'Accept: application/json' 'https://host:port/content/preview/api/v1.1/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/8E01EC77F66840BDB397C30661E6118D?channelToken=f25be6ca65a34208a788c16ec58590a9'
This reads published taxonomy's categories within a taxonomy (id: 72773D667DF247DF836C78F1C1F5B198) with category (id: 8E01EC77F66840BDB397C30661E6118D) in a channel (channelToken:f25be6ca65a34208a788c16ec58590a9).
Response Body
{ "id": "8E01EC77F66840BDB397C30661E6118D", "name": "car red small", "description": "car red small description", "apiName": "te3-c-c-c", "position": 0, "parent": { "id": "A7F8B29894694105952FBD9AA364C18A", "name": "car red", "apiName": "te3-c-c" }, "ancestors": [ { "id": "7519DE99BA3E47DF911E7200F31AFE19", "name": "car", "apiName": "te3-c" }, { "id": "A7F8B29894694105952FBD9AA364C18A", "name": "car red", "apiName": "te3-c-c" } ], "links": [ { "href": "https://<hostname>/content/preview/api/v1.1/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/8E01EC77F66840BDB397C30661E6118D?channelToken=f25be6ca65a34208a788c16ec58590a9", "rel": "self", "method": "GET", "mediaType": "application/json" }, { "href": "https://<hostname>/content/preview/api/v1.1/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/8E01EC77F66840BDB397C30661E6118D?channelToken=f25be6ca65a34208a788c16ec58590a9", "rel": "canonical", "method": "GET", "mediaType": "application/json" }, { "href": "https://<hostname>/content/preview/api/v1.1/metadata-catalog/taxonomies/72773D667DF247DF836C78F1C1F5B198/categories/8E01EC77F66840BDB397C30661E6118D?channelToken=f25be6ca65a34208a788c16ec58590a9", "rel": "describedby", "method": "GET", "mediaType": "application/schema+json" } ] } } ] }