API Reference - Users Activity Log

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

← Back to API Reference | Getting Started

Users Activity Log

The Users Activity Log records platform events for individual members, such as logins, profile updates, and other tracked interactions. This is an append-only logging table — records are written automatically by the platform as activity occurs. While the API exposes create, update, and delete endpoints, typical usage is read-only.

Model name in URL: users_log — DB table: users_log

The Users Activity Log Object

FieldTypeDescription
idintegerUnique log record ID (primary key, read-only)
user_idintegerID of the member associated with this activity
cookiestringVisitor session cookie value at the time of the event
activitytextDescription of the activity (EG Log In, Profile Updated)
typestringActivity category (EG Account, Profile)
datestringTimestamp of the activity (format: YYYYMMDDHHmmss)
datatextAdditional structured data associated with the event; may be empty
httprstringHTTP referrer URL at the time of the event
pagestringPage path where the activity occurred

List Activity Log Records

GET /api/v2/users_log/get

Example Request

Copy
curl -X GET "https://www.yourdomain.com/api/v2/users_log/get?property=user_id&property_value=42&limit=25" \
  -H "X-Api-Key: your-api-key-here"

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "id": "101",
      "user_id": "42",
      "cookie": "",
      "activity": "Log In",
      "type": "Account",
      "date": "20240401120000",
      "data": "",
      "httpr": "https://www.yourdomain.com/admin/viewMembers.php",
      "page": "/login/token/abc123/home"
    }
  ],
  "total": "58",
  "current_page": 1,
  "total_pages": 3,
  "next_page": "MipfKjI1"
}

Retrieve an Activity Log Record

GET /api/v2/users_log/get/{id}

Example Request

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

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "id": "101",
      "user_id": "42",
      "cookie": "",
      "activity": "Log In",
      "type": "Account",
      "date": "20240401120000",
      "data": "",
      "httpr": "https://www.yourdomain.com/admin/viewMembers.php",
      "page": "/login/token/abc123/home"
    }
  ],
  "total": "58",
  "current_page": 1,
  "total_pages": 1
}

Create an Activity Log Record

POST /api/v2/users_log/create

Example Request

Copy
curl -X POST "https://www.yourdomain.com/api/v2/users_log/create" \
  -H "X-Api-Key: your-api-key-here" \
  -d "user_id=42" \
  -d "activity=Log+In" \
  -d "type=Account" \
  -d "date=20240401120000" \
  -d "page=%2Flogin%2Fhome"

Example Response

Copy
{
  "status": "success",
  "message": {
    "id": "102",
    "user_id": "42",
    "cookie": null,
    "activity": "Log In",
    "type": "Account",
    "date": "20240401120000",
    "data": null,
    "httpr": null,
    "page": "/login/home"
  }
}

Update an Activity Log Record

PUT /api/v2/users_log/update

Example Request

Copy
curl -X PUT "https://www.yourdomain.com/api/v2/users_log/update" \
  -H "X-Api-Key: your-api-key-here" \
  -d "id=102" \
  -d "activity=Profile+Updated"

Example Response

Copy
{
  "status": "success",
  "message": {
    "id": "102",
    "user_id": "42",
    "activity": "Profile Updated"
  }
}

Delete an Activity Log Record

DELETE /api/v2/users_log/delete

Example Request

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

Example Response

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

Search Activity Log Records

POST /api/v2/users_log/search
The search endpoint is not currently available for this model.