The "Get Categories" endpoint allows you to retrieve all categories for a specific project within the JustCMS Public API. Categories are essential for organizing your content, and this endpoint ensures that you can access them efficiently.
The "Get Categories" endpoint allows you to retrieve all categories for a specific project within the JustCMS Public API. Categories are essential for organizing your content, and this endpoint ensures that you can access them efficiently.
GET https://api.justcms.co/public/{projectId}/categories
Replace {projectId}
with the unique identifier of the project whose categories you wish to retrieve.
This endpoint requires an authentication token. Include the following header:
Authorization: Bearer YOUR_TOKEN
This endpoint does not accept any query parameters. It returns all categories for the specified project.
200 OK: Returns a list of categories for the project.
403 Forbidden: The request was made without a valid or missing authentication token.
404 Not Found: The specified project could not be found.
Here is an example of a valid request:
GET https://api.justcms.co/public/66d26d17-635e-4206-a1f2-560ae244e9f0/categories
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5...
A successful response (200 OK) will return the following JSON:
{
"categories": [
{ "name": "Blog", "slug": "blog" },
{ "name": "Documentation", "slug": "docs" },
{ "name": "Releases", "slug": "releases" },
{ "name": "News", "slug": "news" }
]
}
Each category object contains:
name: The display name of the category.
slug: A URL-friendly identifier for the category.
Content Organization: Use the returned categories to display content by type (e.g., Blog, News, Documentation).
Dynamic Filtering: Create dynamic interfaces where users can filter content by category.
403 Forbidden: Check that your authentication token is included and valid.
404 Not Found: Verify that the projectId
is correct and exists in your account.