Including its metadata, associated files, and object statistics.
This endpoint returns comprehensive subcategory information including object counts and associated files.
Endpoint
curl -X GET "https://api.g2cplatform.com/api/v2/object/{COMPANY_ID}/category/{CATEGORY_ID}/subcategory/{SUBCATEGORY_ID}" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"
Request
HTTP Method
GET
URL
https://api.g2cplatform.com/api/v2/object/{COMPANY_ID}/category/{CATEGORY_ID}/subcategory/{SUBCATEGORY_ID}
Path Parameters
| Parameter | Type | Required | Description |
|---|
COMPANY_ID | string (UUID) | ✅ | Company identifier |
CATEGORY_ID | string (UUID) | ✅ | Parent category identifier |
SUBCATEGORY_ID | string (UUID) | ✅ | Subcategory identifier |
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Response
Success Response (200)
{
"status": "success",
"data": {
"id": "sub_7f8a9b2c-4d5e-6f7g-8h9i-0j1k2l3m4n5o",
"name": "Smartphones",
"status": "active",
"path": "Electronics/Smartphones",
"description": "Mobile devices and smartphones including Android and iOS devices",
"imageId": "img_1a2b3c4d-5e6f-7g8h-9i0j-1k2l3m4n5o6p",
"createDate": "2025-08-01T11:00:00Z",
"categoryId": "cat_8g9h0i1j-2k3l-4m5n-6o7p-8q9r0s1t2u3v",
"files": [
{
"id": "file_2b3c4d5e-6f7g-8h9i-0j1k-2l3m4n5o6p7q",
"name": "smartphone_specs.pdf",
"title": "Smartphone Specifications Template",
"mimeType": "application/pdf",
"uploadDate": "2025-08-01T15:30:00Z"
}
],
"statistics": {
"totalObjects": 15,
"lastObjectCreated": "2025-08-02T09:15:00Z",
"averageObjectsPerDay": 2.5
}
},
"timestamp": "2025-08-02T10:30:00Z"
}
Subcategory Properties
| Field | Type | Description |
|---|
id | string (UUID) | Unique subcategory identifier |
name | string | Subcategory name |
status | string | Subcategory status (active, delisted, removed) |
path | string | Full hierarchical path |
description | string | Subcategory description |
imageId | string | null | Associated image identifier |
createDate | string (ISO 8601) | Creation timestamp |
categoryId | string (UUID) | Parent category ID |
files | array | Associated files |
statistics | object | Usage statistics |
Error Responses
404 Not Found
{
"error": "Subcategory not found",
"code": "SUBCATEGORY_NOT_FOUND",
"timestamp": "2025-08-02T10:30:00Z"
}
Use Cases
Subcategory Overview
async function getSubcategoryOverview(companyId, categoryId, subcategoryId) {
const response = await fetch(
`https://api.g2cplatform.com/api/v2/object/${companyId}/category/${categoryId}/subcategory/${subcategoryId}`,
{
headers: { 'X-API-Key': 'YOUR_API_KEY' }
}
);
const subcategory = await response.json();
console.log(`Subcategory: ${subcategory.data.path}`);
console.log(`Objects: ${subcategory.data.statistics.totalObjects}`);
return subcategory.data;
}
Next Steps