Get all categories assigned to a view

get

/km/api/v1/repositories/default/categoriesAssignedToView

This method returns a list of Category objects associated with the default Repository object

This resource supports the orderBy request parameter, which allows you to sort the returned list of Category objects.

You can find different values to use with the orderBy parameter in the schema and catalog information of the resource. To get the schema and catalog information, use GET method with the mediaType value as 'application/schema+json' in the HTTP request.

The example URI to get schema and catalog of the resource is as follows:

  • http://<IM_REST_API_HOST>/km/api/latest/metadata-catalog/categories

Example URIs

The example URIs for this method are as follows:

  • http://<IM_REST_API_HOST>/km/api/latest/repositories/default/categoriesAssignedToView

    The request returns a list of Category objects associated for the default Repository object sorted by reference key in ascending order.

  • http://<IM_REST_API_HOST>/km/api/latest/repositories/default/categoriesAssignedToView?orderBy=referenceKey:desc

    The request returns a list of Category objects associated for the default Repository object sorted by reference key in descending order.

Request

Path Parameters
Back to Top

Response

Supported Media Types

200 Response

OK.
Body ()
Root Schema : ResultList CategoryKey
Type: object
Title: ResultList CategoryKey
Show Source
Nested Schema : items
Type: array
Show Source
Nested Schema : CategoryKey
Type: object
Title: CategoryKey
Show Source
  • This field will return number of immediate children a category has.

    This field will only be populated if childrenCount query parameter is passed in with value true.

    Example URIs for the this parameter are as follows:

    • http://<IM_REST_API_HOST>/km/api/categories/{id}?childrenCount=true&mode=KEY
    • http://<IM_REST_API_HOST>/km/api/categories?childrenCount=true&mode=KEY
    • http://<IM_REST_API_HOST>/km/api/categories?q=contentTypeRefKey eq 'FAQ'&childrenCount=true&mode=KEY
  • Description of the Category object
  • The unique identifier used while integrating the repository data with the external system.

  • The type of the category used while integrating the repository data with the external system. Valid options are PRODUCT and CATEGORY.

  • The inventory organization id of the specific product.

  • links
  • The name of the category.

  • The hierarchichal position of the category
  • parents

    This field will return all parents of category.

    This field will only be populated if withParents query parameter is passed in with value true.

    Example URIs for the this parameter are as follows:

    • http://<IM_REST_API_HOST>/km/api/categories/{id}?withParents=true&mode=KEY
    • http://<IM_REST_API_HOST>/km/api/categories?withParents=true&mode=KEY
    • http://<IM_REST_API_HOST>/km/api/categories?q=contentTypeRefKey eq 'FAQ'&withParents=true&mode=KEY
    • http://<IM_REST_API_HOST>/km/api/categories/{id}?childrenCount=true&withParents=true&mode=KEY
  • The unique record ID of the Category object.

  • The reference key for the Category object. Category objects support multiple languages. This field can be used to identify the associated objects for all languages.

  • This is a custom field that will get populated if a name is translated into the default locale when the translated name is not found.

Nested Schema : parents
Type: array

This field will return all parents of category.

This field will only be populated if withParents query parameter is passed in with value true.

Example URIs for the this parameter are as follows:

  • http://<IM_REST_API_HOST>/km/api/categories/{id}?withParents=true&mode=KEY
  • http://<IM_REST_API_HOST>/km/api/categories?withParents=true&mode=KEY
  • http://<IM_REST_API_HOST>/km/api/categories?q=contentTypeRefKey eq 'FAQ'&withParents=true&mode=KEY
  • http://<IM_REST_API_HOST>/km/api/categories/{id}?childrenCount=true&withParents=true&mode=KEY
Show Source
Back to Top

Examples

The following example shows how to find a list of Category objects associated with the default Repository object by submitting a get request on the REST resource using cURL.

curl -X GET "https://<IM_REST_API_HOST>/km/api/latest/repositories/default/categoriesAssignedToView" -u "<username:password>" -H "Accept: application/json" -H "Content-Type: application/json"

Example of Response Body

The following example shows the contents of the response body in JSON format:

{
    "items": [
        {
            "recordId": "7CD781EF6EBA4C4387BCA39869637F67",
            "referenceKey": "FUSION_CATEGORY_300100090490681",
            "objectId": "021",
            "name": "NAME_VALUE1",
            "externalId": 300100090490681,
            "externalType": "CATEGORY",
            "description": "479035114395544",
            "links": [
                {
                    "rel": "canonical",
                    "href": "http://IM_REST_API_HOST/km/api/latest/categories/7CD781EF6EBA4C4387BCA39869637F67",
                    "mediaType": "application/json, application/xml",
                    "method": "GET"
                },
                {
                    "rel": "collection",
                    "href": "http://IM_REST_API_HOST/km/api/latest/categories",
                    "mediaType": "application/json, application/xml",
                    "method": "GET",
                    "profile": "http://IM_REST_API_HOST/km/api/latest/metadata-catalog/categories"
                }
            ]
        },
        {
            "recordId": "A3D96BA9F16F44BC97E0359C615E2966",
            "referenceKey": "FUSION_CATEGORY_300100090490682",
            "objectId": "022",
            "name": "NAME_VALUE2",
            "externalId": 300100090490682,
            "externalType": "CATEGORY",
            "description": "479036550047561",
            "links": [
                {
                    "rel": "canonical",
                    "href": "http://IM_REST_API_HOST/km/api/latest/categories/A3D96BA9F16F44BC97E0359C615E2966",
                    "mediaType": "application/json, application/xml",
                    "method": "GET"
                },
                {
                    "rel": "collection",
                    "href": "http://IM_REST_API_HOST/km/api/latest/categories",
                    "mediaType": "application/json, application/xml",
                    "method": "GET",
                    "profile": "http://IM_REST_API_HOST/km/api/latest/metadata-catalog/categories"
                }
            ]
        }
    ],
    "hasMore": true,
    "limit": 20,
    "offset": 0,
    "links": [
        {
            "rel": "canonical",
            "href": "http://IM_REST_API_HOST/km/api/latest/repositories/default/categoriesAssignedToView?limit=20&offset=0",
            "mediaType": "application/json, application/xml",
            "method": "GET"
        },
        {
            "rel": "next",
            "href": "http://IM_REST_API_HOST/km/api/latest/repositories/default/categoriesAssignedToView?limit=20&offset=20",
            "mediaType": "application/json, application/xml",
            "method": "GET"
        }
    ],
    "count": 2
}
Back to Top