API Reference - Contact Links

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

← Back to API Reference | Getting Started

Contact Links

Contact Links are junction records that associate a contact with another object in the system, such as a contact category or a member profile. Each record links a single contact to a single related record, allowing contacts to be organized into groups or assigned to members.

Model name in URL: contacts_bridge — DB table: contacts_bridge

The Contact Link Object

FieldTypeDescription
link_idintegerUnique link ID (primary key, read-only)
contact_idintegerID of the contact being linked
link_dbstringName of the table being linked to (EG contact_categories, users_data)
rel_idintegerID of the record in the link_db table
link_orderintegerDisplay sort order for this link
link_datestringDate the link was created (format: YYYYMMDDHHmmss)
user_idintegerID of the user who created the link (0 for system-created)
revision_timestamptimestampTimestamp of last record modification (auto-managed)

List Contact Links

GET /api/v2/contacts_bridge/get

Example Request

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

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "link_id": "1",
      "contact_id": "42",
      "link_db": "contact_categories",
      "rel_id": "5",
      "link_order": "1",
      "link_date": "20240301120000",
      "user_id": "0",
      "revision_timestamp": "2024-03-01 12:00:00"
    }
  ],
  "total": "1",
  "current_page": 1,
  "total_pages": 1
}

Retrieve a Contact Link

GET /api/v2/contacts_bridge/get/{link_id}

Example Request

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

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "link_id": "1",
      "contact_id": "42",
      "link_db": "contact_categories",
      "rel_id": "5",
      "link_order": "1",
      "link_date": "20240301120000",
      "user_id": "0",
      "revision_timestamp": "2024-03-01 12:00:00"
    }
  ],
  "total": "1",
  "current_page": 1,
  "total_pages": 1
}

Create a Contact Link

POST /api/v2/contacts_bridge/create

Example Request

Copy
curl -X POST "https://www.yourdomain.com/api/v2/contacts_bridge/create" \
  -H "X-Api-Key: your-api-key-here" \
  -d "contact_id=42" \
  -d "link_db=contact_categories" \
  -d "rel_id=5" \
  -d "link_order=1" \
  -d "link_date=20240301120000" \
  -d "user_id=0"

Example Response

Copy
{
  "status": "success",
  "message": {
    "link_id": "2",
    "contact_id": "42",
    "link_db": "contact_categories",
    "rel_id": "5",
    "link_order": "1",
    "link_date": "20240301120000",
    "user_id": "0",
    "revision_timestamp": null
  }
}

Update a Contact Link

PUT /api/v2/contacts_bridge/update

Example Request

Copy
curl -X PUT "https://www.yourdomain.com/api/v2/contacts_bridge/update" \
  -H "X-Api-Key: your-api-key-here" \
  -d "link_id=2" \
  -d "link_order=2"

Example Response

Copy
{
  "status": "success",
  "message": {
    "link_id": "2",
    "contact_id": "42",
    "link_db": "contact_categories",
    "rel_id": "5",
    "link_order": "2",
    "link_date": "20240301120000",
    "user_id": "0",
    "revision_timestamp": "2024-03-02 09:00:00"
  }
}

Delete a Contact Link

DELETE /api/v2/contacts_bridge/delete

Example Request

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

Example Response

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