API Reference - Categories (Professions)
Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108057
← Back to API Reference | Getting Started
Categories (Professions)
Categories (also called Professions) are the primary classification system for members and content on your directory. Each category can be associated with a category group and used to organize member listings, search results, and browse pages.
Model name in URL:
category — DB table: categoryThe Category Object
| Field | Type | Description |
|---|---|---|
category_id | integer | Unique category ID (primary key, read-only) |
name | string | Display name of the category |
group_id | integer | ID of the category group this category belongs to |
filename | string | URL-friendly slug for the category page |
icon | string | Icon class or image reference for this category |
keywords | text | SEO keywords associated with this category |
revision_timestamp | timestamp | Last modified timestamp (auto-updated) |
json_meta | text | Additional metadata stored as JSON |
List Category Records
GET /api/v2/category/get
Returns a paginated list of category records.
Example Request
Copy
curl -X GET "https://www.yourdomain.com/api/v2/category/get?limit=25" \ -H "X-Api-Key: your-api-key-here"
Example Response
Copy
{
"status": "success",
"message": [
{
"category_id": "1",
"name": "Plumbers",
"group_id": "1",
"filename": "plumbers",
"icon": "",
"keywords": "plumber, plumbing, pipe repair",
"revision_timestamp": "2024-01-15 09:30:00",
"json_meta": ""
}
],
"total": "1",
"current_page": 1,
"total_pages": 1
}Retrieve a Category Record
GET /api/v2/category/get/{category_id}
Example Request
Copy
curl -X GET "https://www.yourdomain.com/api/v2/category/get/1" \ -H "X-Api-Key: your-api-key-here"
Example Response
Copy
{
"status": "success",
"message": [
{
"category_id": "1",
"name": "Plumbers",
"group_id": "1",
"filename": "plumbers",
"icon": "",
"keywords": "plumber, plumbing, pipe repair",
"revision_timestamp": "2024-01-15 09:30:00",
"json_meta": ""
}
],
"total": "1",
"current_page": 1,
"total_pages": 1
}Create a Category Record
POST /api/v2/category/create
Example Request
Copy
curl -X POST "https://www.yourdomain.com/api/v2/category/create" \ -H "X-Api-Key: your-api-key-here" \ -d "name=Electricians" \ -d "filename=electricians" \ -d "group_id=1" \ -d "keywords=electrician,electrical,wiring"
Example Response
Copy
{
"status": "success",
"message": {
"category_id": "2",
"name": "Electricians",
"group_id": "1",
"filename": "electricians",
"icon": null,
"keywords": "electrician,electrical,wiring",
"revision_timestamp": null,
"json_meta": null
}
}Update a Category Record
PUT /api/v2/category/update
Example Request
Copy
curl -X PUT "https://www.yourdomain.com/api/v2/category/update" \ -H "X-Api-Key: your-api-key-here" \ -d "category_id=2" \ -d "name=Licensed+Electricians" \ -d "keywords=licensed+electrician,electrical,wiring"
Example Response
Copy
{
"status": "success",
"message": {
"category_id": "2",
"name": "Licensed Electricians",
"group_id": "1",
"filename": "electricians",
"icon": "",
"keywords": "licensed electrician,electrical,wiring",
"revision_timestamp": "0000-00-00 00:00:00",
"json_meta": ""
}
}Delete a Category Record
DELETE /api/v2/category/delete
Example Request
Copy
curl -X DELETE "https://www.yourdomain.com/api/v2/category/delete" \ -H "X-Api-Key: your-api-key-here" \ -d "category_id=2"
Example Response
Copy
{
"status": "success",
"message": "category record was deleted"
}