Read a Published Category

get

/content/published/api/v1.1/taxonomies/{id}/categories/{categoryId}

Returns published category. A category is uniquely identified by an id.
Each published category has the following information:
  1. 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.
  2. Additional fields: These fields are not included by default in the response.
    • keywords: A comma-separated list of values assigned to the keywords system managed category property.
    • synonyms: A comma-separated list of values assigned to the synonyms system managed category property.
    • relatedCategories: A list where each element represents a category that is related to the current category. Note that this field only shows the categories published to the same channel as the current category.
    • customProperties: Category property values for the user defined category properties. Note that this field only shows the category property values of the publishable category properties.

Request Headers (Optional) :
Header NameHeader Value
channelToken{valid channel token value}
Acceptapplication/json

Request

Path Parameters
Query Parameters
  • Channel token of the publish target. A channel token must be provided as either a query parameter or a request header.
  • 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.
  • This parameter is used to control the returned fields for a category. This parameter accepts a comma-separated list of field names. As all the field names are case-sensitive, users must provide the correct field names in the query. A category has both standard fields (id, name, description, position, parentId) and additional fields (keywords, synonyms, relatedCategories, customProperties). The standard fields are always returned in the response and cannot be filtered out. Users can only filter out the additional fields. This parameter is optional in the query and by default results shows only standard fields in the response. Any incorrect or invalid field name given in the query will result in an error.

    Example: ?fields=keywords
    This returns all standard fields along with the keywords additional field for the category.
Back to Top

Response

Supported Media Types

200 Response

Successful operation.
Body ()
Root Schema : CategoryInformation
Type: object
Category Information
Show Source
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
Nested Schema : customProperties
Type: object
Additional Properties Allowed
Show Source
The custom properties' values of the Category.
Nested Schema : keywords
Type: array
The keywords of the Category.
Show Source
Nested Schema : CategoryAncestorBean
Type: object
Show Source
Nested Schema : relatedCategories
Type: array
The related categories of the Category.
Show Source
Nested Schema : synonyms
Type: array
The synonyms of the Category.
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 : properties
Type: object
Additional Properties Allowed
Show Source
additional collection properties.
Nested Schema : AggregationResult
Type: object
Show Source
Nested Schema : CategoryChildBean
Type: object
Show Source
Nested Schema : additionalProperties
Type: object
Nested Schema : CustomPropertyValuesBean
Type: object
Show Source
Nested Schema : values
Type: array
The list of values of the custom property.
Show Source
Nested Schema : CustomPropertyValue
Type: object
Show Source
Nested Schema : RelatedCategory
Type: object
Related Category
Show Source
Nested Schema : nodes
Type: array
The path of the category.
Show Source
Nested Schema : RelatedTaxonomyBean
Type: object
Show Source
Nested Schema : CategoryNodeItem
Type: object
CategoryNodeBean
Show Source

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.
Back to Top

Examples

The following example shows how to read published taxonomy category.

curl -i -X GET -H "Accept:application/json" 'http://<hostname>/content/published/api/v1.1/taxonomies/{id}/categories/{categoryId}'
Example

Searches published taxonomy category with taxonomy id: 26950D77A5654D8BA407AC9F7DBCFF1F, having category id: 2069018ECE874C2DAA4051E9C16AD244 with channelToken: 1a3885a5a75b40baafe6495eb0b1125b.

/content/published/api/v1.1/taxonomies/26950D77A5654D8BA407AC9F7DBCFF1F/categories/5096C5762F9540BCB23AA13001CA872E?channelToken=1a3885a5a75b40baafe6495eb0b1125b

Response Body

{
        "id": "5096C5762F9540BCB23AA13001CA872E",
        "name": "car blue",
        "description": "car description",
        "apiName": "t31-car-blue-26950d77a5654d8ba407ac9f7dbcff1f",
        "position": 1,
        "parent": {
          "id": "6775D3D56E184CC3B8EC59A32AF1DD73",
          "name": "car",
          "apiName": "t31-c"
        },
        "ancestors": [
          {
            "id": "6775D3D56E184CC3B8EC59A32AF1DD73",
            "name": "car",
            "apiName": "t31-c"
          }
        ],
        "links": [
          {
            "href": "https://<hostname>/content/published/api/v1.1/taxonomies/26950D77A5654D8BA407AC9F7DBCFF1F/categories/5096C5762F9540BCB23AA13001CA872E?channelToken=1a3885a5a75b40baafe6495eb0b1125b",
            "rel": "self",
            "method": "GET",
            "mediaType": "application/json"
          },
          {
            "href": "https://<hostname>/content/published/api/v1.1/taxonomies/26950D77A5654D8BA407AC9F7DBCFF1F/categories/5096C5762F9540BCB23AA13001CA872E?channelToken=1a3885a5a75b40baafe6495eb0b1125b",
            "rel": "canonical",
            "method": "GET",
            "mediaType": "application/json"
          },
          {
            "href": "https://<hostname>/content/published/api/v1.1/metadata-catalog/taxonomies/26950D77A5654D8BA407AC9F7DBCFF1F/categories/5096C5762F9540BCB23AA13001CA872E?channelToken=1a3885a5a75b40baafe6495eb0b1125b",
            "rel": "describedby",
            "method": "GET",
            "mediaType": "application/schema+json"
          }
        ]
      }       
Back to Top