Plugin Records

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

← Back to API Reference | Getting Started

Plugin Records

Plugin Records define the installed addon modules on a directory site. Each record identifies a plugin by a machine-readable variable name and a human-friendly nickname, tracks whether it is currently active, and stores an optional admin panel link URL. Plugin records are used by the admin role permissions system to control which plugins sub-administrators can access.

Model name in URL: plugin_records — DB table: plugin_records

The Plugin Record Object

FieldTypeDescription
plugin_record_idintegerUnique plugin record ID (primary key, read-only)
activeintegerWhether this plugin is currently active on the site; 1 = active, 0 = inactive required on create
variable_namestringMachine-readable unique identifier for this plugin (EG events_plugin, jobs_board); max 80 characters; must be unique required on create
nick_namestringHuman-readable display name for this plugin (EG Events Plugin, Jobs Board); max 80 characters required on create
link_urlstringRelative URL to this plugin's admin panel page (EG /admin/plugins/events); max 100 characters

List Plugin Records

GET /api/v2/plugin_records/get

Example Request

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

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "plugin_record_id": "1",
      "active": "1",
      "variable_name": "events_plugin",
      "nick_name": "Events Plugin",
      "link_url": "/admin/plugins/events"
    },
    {
      "plugin_record_id": "2",
      "active": "0",
      "variable_name": "jobs_board",
      "nick_name": "Jobs Board",
      "link_url": "/admin/plugins/jobs"
    }
  ],
  "total": "2",
  "current_page": 1,
  "total_pages": 1
}

Retrieve a Plugin Record

GET /api/v2/plugin_records/get/{plugin_record_id}

Example Request

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

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "plugin_record_id": "1",
      "active": "1",
      "variable_name": "events_plugin",
      "nick_name": "Events Plugin",
      "link_url": "/admin/plugins/events"
    }
  ],
  "total": "1",
  "current_page": 1,
  "total_pages": 1
}

Create a Plugin Record

POST /api/v2/plugin_records/create

Example Request

Copy
curl -X POST "https://www.yourdomain.com/api/v2/plugin_records/create" \
  -H "X-Api-Key: your-api-key-here" \
  -d "active=1" \
  -d "variable_name=booking_plugin" \
  -d "nick_name=Booking+Plugin" \
  -d "link_url=/admin/plugins/booking"

Example Response

Copy
{
  "status": "success",
  "message": {
    "plugin_record_id": "3",
    "active": "1",
    "variable_name": "booking_plugin",
    "nick_name": "Booking Plugin",
    "link_url": "/admin/plugins/booking"
  }
}

Update a Plugin Record

PUT /api/v2/plugin_records/update

Example Request

Copy
curl -X PUT "https://www.yourdomain.com/api/v2/plugin_records/update" \
  -H "X-Api-Key: your-api-key-here" \
  -d "plugin_record_id=3" \
  -d "active=0" \
  -d "nick_name=Booking+Plugin+%28Disabled%29"

Example Response

Copy
{
  "status": "success",
  "message": {
    "plugin_record_id": "3",
    "active": "0",
    "variable_name": "booking_plugin",
    "nick_name": "Booking Plugin (Disabled)",
    "link_url": "/admin/plugins/booking"
  }
}

Delete a Plugin Record

DELETE /api/v2/plugin_records/delete

Example Request

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

Example Response

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