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:
list_professions — DB table: list_professionsThe Category Object
| Field | Type | Description |
|---|---|---|
profession_id | integer | Unique category ID (primary key, read-only) |
name | string | Display name of the category |
desc | text | Long description of the category |
filename | string | URL-friendly slug for the category page |
keywords | text | SEO keywords associated with this category |
icon | string | Icon class or image reference for this category |
image | string | Path to the category image |
sort_order | integer | Display order for sorting categories |
lead_price | decimal | Default lead price for this category (nullable) |
revision_timestamp | timestamp | Last modified timestamp (auto-updated) |
List Category Records
GET /api/v2/list_professions/get
Returns a paginated list of category records.
Example Request
Copy
curl -X GET "https://www.yourdomain.com/api/v2/list_professions/get?limit=25" \ -H "X-Api-Key: your-api-key-here"
Example Response
Copy
{
"status": "success",
"message": [
{
"profession_id": "1",
"name": "Plumbers",
"desc": "",
"filename": "plumbers",
"keywords": "plumber, plumbing, pipe repair",
"icon": "",
"image": "/images/cat.jpg",
"sort_order": "0",
"lead_price": null,
"revision_timestamp": "2024-01-15 09:30:00"
}
],
"total": "1",
"current_page": 1,
"total_pages": 1
}Retrieve a Category Record
GET /api/v2/list_professions/get/{profession_id}
Example Request
Copy
curl -X GET "https://www.yourdomain.com/api/v2/list_professions/get/1" \ -H "X-Api-Key: your-api-key-here"
Example Response
Copy
{
"status": "success",
"message": [
{
"profession_id": "1",
"name": "Plumbers",
"desc": "",
"filename": "plumbers",
"keywords": "plumber, plumbing, pipe repair",
"icon": "",
"image": "/images/cat.jpg",
"sort_order": "0",
"lead_price": null,
"revision_timestamp": "2024-01-15 09:30:00"
}
],
"total": "1",
"current_page": 1,
"total_pages": 1
}Create a Category Record
POST /api/v2/list_professions/create
Example Request
Copy
curl -X POST "https://www.yourdomain.com/api/v2/list_professions/create" \ -H "X-Api-Key: your-api-key-here" \ -d "name=Electricians" \ -d "filename=electricians" \ -d "keywords=electrician,electrical,wiring"
Example Response
Copy
{
"status": "success",
"message": {
"profession_id": "2",
"name": "Electricians",
"desc": "",
"filename": "electricians",
"keywords": "electrician,electrical,wiring",
"icon": "",
"image": "",
"sort_order": "0",
"lead_price": null,
"revision_timestamp": null
}
}Update a Category Record
PUT /api/v2/list_professions/update
Example Request
Copy
curl -X PUT "https://www.yourdomain.com/api/v2/list_professions/update" \ -H "X-Api-Key: your-api-key-here" \ -d "profession_id=2" \ -d "name=Licensed+Electricians" \ -d "keywords=licensed+electrician,electrical,wiring"
Example Response
Copy
{
"status": "success",
"message": {
"profession_id": "2",
"name": "Licensed Electricians",
"desc": "",
"filename": "electricians",
"keywords": "licensed electrician,electrical,wiring",
"icon": "",
"image": "",
"sort_order": "0",
"lead_price": null,
"revision_timestamp": "2024-01-15 09:30:00"
}
}Delete a Category Record
DELETE /api/v2/list_professions/delete
Example Request
Copy
curl -X DELETE "https://www.yourdomain.com/api/v2/list_professions/delete" \ -H "X-Api-Key: your-api-key-here" \ -d "profession_id=2"
Example Response
Copy
{
"status": "success",
"message": "list_professions record was deleted"
}