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. 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.
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 : CategoryAncestorBean
Type: object
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

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