Get Specific Category
GET /categories/{correlationId} - Get Specific Category
Retrieve detailed information about a specific category by its correlation ID. This endpoint returns the category's properties and content in all available languages.
Endpoint
GET /v1/knowledge-base/categories/{correlationId}Request Headers
Header | Value | Required |
|---|---|---|
|
| Yes |
Path Parameters
Parameter | Type | Required | Description |
|---|---|---|---|
|
| Yes | The correlation ID of the category. Can be custom ID or internal ID prefixed with 'pf_' |
Correlation ID Format
- Custom IDs: Use your own correlation ID as provided during import (e.g.,
"docs-category") - Internal IDs: Use internal database ID prefixed with
"pf_"(e.g.,"pf_123")
Response Format
Success Response (200 OK)
{
"id": 123,
"correlationId": "docs-category",
"parentCategoryId": null,
"order": 1,
"isFeatured": true,
"icon": "image-guid-123",
"contents": [
{
"lang": "en",
"title": "Documentation",
"description": "All documentation and guides",
"slug": "docs",
"slug_state": "manual"
},
{
"lang": "es",
"title": "Documentación",
"description": "Toda la documentación y guías",
"slug": "documentacion",
"slug_state": "auto"
}
]
}Response Fields
Field | Type | Description | Example |
|---|---|---|---|
|
| Internal database ID of the category |
|
|
| Custom correlation ID (if set) |
|
|
| Parent category ID (null for root categories) |
|
|
| Display order within parent category |
|
|
| Whether category is featured |
|
|
| Category icon (CDN image GUID) |
|
|
| Category content in different languages | See Content Object below |
Content Object (contents[])
Field | Type | Description | Example |
|---|---|---|---|
|
| Language code (ISO 639-1) |
|
|
| Category title |
|
|
| Category description |
|
|
| URL slug |
|
|
| Slug generation mode: "auto" or "manual" |
|
Examples
Example 1: Get Category by Custom Correlation ID
curl -X GET "https://api.productfruits.com/v1/knowledgebase/categories/docs-category" \
-H "Authorization: Bearer YOUR_API_TOKEN"Response:
{
"id": 123,
"correlationId": "docs-category",
"parentCategoryId": null,
"order": 1,
"isFeatured": true,
"icon": "image-guid-123",
"contents": [
{
"lang": "en",
"title": "Documentation",
"description": "Complete documentation and guides",
"slug": "docs",
"slug_state": "manual"
},
{
"lang": "es",
"title": "Documentación",
"description": "Documentación completa y guías",
"slug": "documentacion",
"slug_state": "auto"
}
]
}Example 2: Get Category by Internal ID
curl -X GET "https://api.productfruits.com/v1/knowledgebase/categories/pf_123" \
-H "Authorization: Bearer YOUR_API_TOKEN"Response:
{
"id": 123,
"correlationId": "docs-category",
"parentCategoryId": null,
"order": 1,
"isFeatured": true,
"icon": "image-guid-123",
"contents": [
{
"lang": "en",
"title": "Documentation",
"description": "Complete documentation and guides",
"slug": "docs",
"slug_state": "manual"
}
]
}Example 3: Error Handling Example
curl -X GET "https://api.productfruits.com/v1/knowledgebase/categories/non-existent-category" \
-H "Authorization: Bearer YOUR_API_TOKEN"Response (404 Not Found):
{
"error": "Category with correlation ID 'non-existent-category' not found"
}Common Use Cases
Category Validation
Verify that a specific category exists before performing operations:
- Check category properties before updates
- Validate correlation IDs before referencing in article imports
- Confirm category hierarchy relationships
Content Localization Planning
Review category content across languages:
- Identify missing translations for specific categories
- Check slug consistency across languages
- Plan localization efforts for category content
Integration Synchronization
Synchronize category data with external systems:
- Retrieve current category state for comparison
- Validate category properties after imports
- Maintain consistency between systems
Hierarchy Analysis
Understand category relationships and structure:
- Check parent-child relationships
- Verify category ordering within hierarchies
- Analyze featured category status
Best Practices
- Validate Before Operations: Check category exists before referencing in other operations
- Handle Missing Categories: Implement proper error handling for non-existent categories
- Cache Category Data: Store frequently accessed category information locally
- Monitor Changes: Use this endpoint to detect changes in category structure
- Verify Correlation IDs: Confirm correlation ID format and existence before API calls
Common Error Scenarios
Category Not Found
Cause: Using incorrect correlation ID or category doesn't exist
Solution: Verify correlation ID using GET /categories endpoint first
Invalid Correlation ID Format
Cause: Malformed correlation ID or incorrect internal ID prefix
Solution: Use proper format (custom ID or "pf_" + internal ID)
Authentication Issues
Cause: Invalid or expired API token
Solution: Regenerate API token and update authorization header
Permission Issues
Cause: API token lacks category read permissions
Solution: Check API token permissions and user roles
Error Response Examples
400 Bad Request - Missing Correlation ID
{
"error": "Correlation ID is required"
}401 Unauthorized
{
"error": "Authentication required or invalid API token"
}404 Not Found
{
"error": "Category with correlation ID 'invalid-id' not found"
}500 Internal Server Error
{
"error": "Internal server error occurred while retrieving category"
}Rate Limiting
For detailed information about API limits and optimization strategies, please refer to this guide.