API Reference - Services

Link: https://support.brilliantdirectories.com/support/solutions/articles/12000108122

← Back to API Reference | Getting Started

Services

The Services table contains the master list of service offerings that can be associated with member categories (professions). Services are used throughout the platform for filtering search results, generating SEO pages, and displaying member specialties. This is primarily a reference table used for GET operations; while CRUD endpoints are available, service records are typically managed through the admin panel.

Model name in URL: list_services — DB table: list_services

The Service Object

FieldTypeDescription
service_idintegerUnique service ID (primary key, read-only)
namestringDisplay name of the service (EG Plumbing Repairs); max 255 characters
desctextDescription of the service
profession_idintegerID of the parent category (profession) this service belongs to; references category.category_id
master_idintegerID of the master service record if this is a variant; 0 for top-level services
filenamestringURL-friendly slug for the service page (EG plumbing-repairs); max 1000 characters
keywordsstringComma-separated SEO keywords for this service; max 255 characters
revision_timestamptimestampLast modified timestamp (auto-updated)
sort_orderintegerDisplay sort order for this service within its category
lead_pricenumberDefault lead price for this service type (nullable)
imagestringPath to the service image (computed field, not stored directly in this table)

List Services

GET /api/v2/list_services/get

Returns a paginated list of service records.

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/list_services/get?limit=25" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "service_id": "1",
      "name": "Amateur Sports Teams",
      "desc": "",
      "profession_id": "1",
      "master_id": "0",
      "filename": "amateur-sports-teams",
      "keywords": "",
      "revision_timestamp": "2024-11-05 12:37:21",
      "sort_order": "0",
      "lead_price": "101.00",
      "image": "/images/cat.jpg"
    }
  ],
  "total": "763",
  "current_page": 1,
  "total_pages": 31,
  "next_page": "MipfKjI="
}

Retrieve a Service Record

GET /api/v2/list_services/get/{service_id}

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/list_services/get/1" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "service_id": "1",
      "name": "Amateur Sports Teams",
      "desc": "",
      "profession_id": "1",
      "master_id": "0",
      "filename": "amateur-sports-teams",
      "keywords": "",
      "revision_timestamp": "2024-11-05 12:37:21",
      "sort_order": "0",
      "lead_price": "101.00",
      "image": "/images/cat.jpg"
    }
  ],
  "total": "1",
  "current_page": 1,
  "total_pages": 1
}

Create a Service Record

POST /api/v2/list_services/create

Example Request

Copy
curl -X POST "https://www.yourdomain.com/api/v2/list_services/create" \
  -H "X-Api-Key: your-api-key-here" \
  -d "name=Emergency+Plumbing" \
  -d "profession_id=5" \
  -d "filename=emergency-plumbing" \
  -d "keywords=emergency,plumbing,24-hour" \
  -d "sort_order=10"

Example Response

Copy
{
  "status": "success",
  "message": {
    "service_id": "764",
    "name": "Emergency Plumbing",
    "desc": null,
    "profession_id": "5",
    "master_id": null,
    "filename": "emergency-plumbing",
    "keywords": "emergency,plumbing,24-hour",
    "revision_timestamp": null,
    "sort_order": "10",
    "lead_price": null
  }
}

Update a Service Record

PUT /api/v2/list_services/update

Example Request

Copy
curl -X PUT "https://www.yourdomain.com/api/v2/list_services/update" \
  -H "X-Api-Key: your-api-key-here" \
  -d "service_id=764" \
  -d "lead_price=75.00" \
  -d "keywords=emergency,plumbing,24-hour,urgent"

Example Response

Copy
{
  "status": "success",
  "message": {
    "service_id": "764",
    "name": "Emergency Plumbing",
    "desc": "",
    "profession_id": "5",
    "master_id": "0",
    "filename": "emergency-plumbing",
    "keywords": "emergency,plumbing,24-hour,urgent",
    "revision_timestamp": "0000-00-00 00:00:00",
    "sort_order": "10",
    "lead_price": "75.00"
  }
}

Delete a Service Record

DELETE /api/v2/list_services/delete

Example Request

Copy
curl -X DELETE "https://www.yourdomain.com/api/v2/list_services/delete" \
  -H "X-Api-Key: your-api-key-here" \
  -d "service_id=764"

Example Response

Copy
{
  "status": "success",
  "message": "list_services record was deleted"
}