API Reference - Business Data Logs

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

← Back to API Reference | Getting Started

Business Data Logs

Business Data Logs are the per-record audit trail for the Business Data Import system. Each log entry corresponds to a single imported member record and tracks the import payload, geocoding status, image import status, and overall processing state. Logs are linked to a parent Business Data Task and to the user record that was created or updated by the import.

Model name in URL: business_data_logs — DB table: business_data_logs

The Business Data Log Object

FieldTypeDescription
idintegerUnique log entry ID (primary key, read-only)
unique_api_idstringUnique identifier from the external data source API for this business record; max 500 characters required on create
user_idintegerForeign key referencing the user record created or updated by this import required on create
user_recordtextJSON-encoded data payload that was used to create or update the user record
business_data_task_idintegerForeign key referencing the parent business_data_api_task record required on create
geo_code_statusintegerGeocoding processing status; 0 = pending, 1 = complete
image_import_statusintegerImage import processing status; 0 = pending, 1 = complete, null = not applicable
user_actions_statusintegerOverall user action processing status; 0 = pending, 1 = complete, null = not applicable
added_byintegerForeign key referencing the administrator who initiated the import required on create
created_atdatetimeDatetime when this log entry was created
user_updated_atdatetimeDatetime when the associated user record was last updated by the import pipeline

List Business Data Logs

GET /api/v2/business_data_logs/get

Example Request

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

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "id": "1",
      "unique_api_id": "10795884555057933763",
      "user_id": "1107",
      "user_record": "{\"company\":\"Acme Corp\",\"phone_number\":\"+1555-123-4567\"}",
      "business_data_task_id": "1",
      "geo_code_status": "1",
      "image_import_status": "1",
      "user_actions_status": "1",
      "added_by": "27",
      "created_at": "2024-06-13 17:55:55",
      "user_updated_at": "2024-06-13 16:55:58"
    }
  ],
  "total": "107",
  "current_page": 1,
  "total_pages": 5,
  "next_page": "MipfKjI1"
}

Retrieve a Business Data Log

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

Example Request

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

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "id": "1",
      "unique_api_id": "10795884555057933763",
      "user_id": "1107",
      "user_record": "{\"company\":\"Acme Corp\",\"phone_number\":\"+1555-123-4567\"}",
      "business_data_task_id": "1",
      "geo_code_status": "1",
      "image_import_status": "1",
      "user_actions_status": "1",
      "added_by": "27",
      "created_at": "2024-06-13 17:55:55",
      "user_updated_at": "2024-06-13 16:55:58"
    }
  ],
  "total": "1",
  "current_page": 1,
  "total_pages": 1
}

Create a Business Data Log

POST /api/v2/business_data_logs/create

Example Request

Copy
curl -X POST "https://www.yourdomain.com/api/v2/business_data_logs/create" \
  -H "X-Api-Key: your-api-key-here" \
  -d "unique_api_id=ChIJrTLr-GyuEmsRBfy61i59si0" \
  -d "user_id=1200" \
  -d "user_record={\"company\":\"Acme Corp\"}" \
  -d "business_data_task_id=5" \
  -d "geo_code_status=0" \
  -d "image_import_status=0" \
  -d "user_actions_status=0" \
  -d "added_by=27"

Example Response

Copy
{
  "status": "success",
  "message": {
    "id": "108",
    "unique_api_id": "ChIJrTLr-GyuEmsRBfy61i59si0",
    "user_id": "1200",
    "user_record": "{\"company\":\"Acme Corp\"}",
    "business_data_task_id": "5",
    "geo_code_status": "0",
    "image_import_status": "0",
    "user_actions_status": "0",
    "added_by": "27",
    "created_at": null,
    "user_updated_at": null
  }
}

Update a Business Data Log

PUT /api/v2/business_data_logs/update

Example Request

Copy
curl -X PUT "https://www.yourdomain.com/api/v2/business_data_logs/update" \
  -H "X-Api-Key: your-api-key-here" \
  -d "id=108" \
  -d "geo_code_status=1" \
  -d "image_import_status=1" \
  -d "user_actions_status=1"

Example Response

Copy
{
  "status": "success",
  "message": {
    "id": "108",
    "unique_api_id": "ChIJrTLr-GyuEmsRBfy61i59si0",
    "user_id": "1200",
    "user_record": "{\"company\":\"Acme Corp\"}",
    "business_data_task_id": "5",
    "geo_code_status": "1",
    "image_import_status": "1",
    "user_actions_status": "1",
    "added_by": "27",
    "created_at": "0000-00-00 00:00:00",
    "user_updated_at": "0000-00-00 00:00:00"
  }
}

Delete a Business Data Log

DELETE /api/v2/business_data_logs/delete

Example Request

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

Example Response

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