Categories

Using the /categories endpoint you can fetch the categories.

The category model

The category model contains all the information about your categories, such as their id, slug, description, and more. Here are the base properties:

Properties

  • Name
    id
    Type
    string
    Description

    Unique identifier for the article.

  • Name
    localized
    Type
    object
    Description

    Returns the localized properties of the category, such as slug, name and description.


GET/v0/categories

List all categories

This endpoint allows you to retrieve a list of all your categories.

Optional attributes

  • Name
    localeCode
    Type
    string
    Description

    The locale for which you want to fetch the author for.

Response Type (Typescript)

interface Category {
  id: string
  createdAt: string
  updatedAt: string
  localized: {
    [languageCode: string]: LocalizedCategory
  }
}

interface LocalizedCategory {
  name: string
  slug: string
  description: string
}

Request

GET
/v0/:blogId/categories
curl -G https://api.vaporcms.com/v0/{blogId}/categories \
  -H "Authorization: Bearer {token}" \
  -d limit=10

Response

[
    {
        "id": "cm1uxv73n001bfe8j0z5nm01g",
        "createdAt": "2024-10-04T16:27:40.595Z",
        "updatedAt": "2024-10-04T16:27:40.595Z",
        "localized": {
            "en": {
                "name": "Software",
                "slug": "software",
                "description": "The Software category goes over popular content marketing software, doing comparisons, reviews, and more."
            },
            "es": {
                "name": "Software",
                "slug": "software",
                "description": "La categoría de software abarca software popular de marketing de contenidos, haciendo comparaciones, reseñas y más."
            },
            "ja": {
                "name": "ソフトウェア",
                "slug": "software",
                "description": "ソフトウェアカテゴリーでは、人気のあるコンテンツマーケティングソフトウェアについて、比較、レビューなどを行っています。"
            },
            "de": {
                "name": "Software",
                "slug": "software",
                "description": "Die Kategorie \"Software\" behandelt beliebte Content-Marketing-Software, bietet Vergleiche, Bewertungen und mehr."
            }
        }
    }
]

Was this page helpful?