API Reference - Business Data Tasks

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

← Back to API Reference | Getting Started

Business Data Tasks

Business Data Tasks represent individual bulk import jobs in the Business Data Import system. Each task defines the search parameters used to fetch business records from an external data source, tracks the overall processing state (geocoding, image imports, user actions), and records start/completion times and total record counts. Individual imported records are tracked in Business Data Logs.

Model name in URL: business_data_api_task — DB table: business_data_api_task

The Business Data Task Object

FieldTypeDescription
idintegerUnique task ID (primary key, read-only)
search_parameterstextJSON-encoded object describing the search criteria used for this import job (EG category, location, required fields)
cache_filestringFilename or path of the cached API response file for this task; max 500 characters
api_typestringIdentifier for the external business data source this task was pulled from; max 500 characters
geo_code_statusintegerGeocoding processing status for all records in this task; 0 = pending, 1 = complete, null = not applicable
image_import_statusintegerImage import processing status for all records in this task; 0 = pending, 1 = complete, null = not applicable
user_actions_statusintegerOverall user action processing status for all records; 0 = pending, 1 = complete, null = not applicable
start_datedatetimeDatetime when this import task began processing
complete_datedatetimeDatetime when this import task finished processing
total_recordsintegerTotal number of records imported or processed by this task

List Business Data Tasks

GET /api/v2/business_data_api_task/get

Example Request

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

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "id": "1",
      "search_parameters": "{\"category\":\"Property management company\",\"location\":\"Austin, TX\"}",
      "cache_file": "ea66bf0b769c7b323292a8f0aca52299.bd",
      "api_type": "google_places",
      "geo_code_status": "1",
      "image_import_status": "1",
      "user_actions_status": "0",
      "start_date": "2024-06-13 17:55:55",
      "complete_date": "2024-06-13 16:55:58",
      "total_records": "4"
    }
  ],
  "total": "21",
  "current_page": 1,
  "total_pages": 5,
  "next_page": "MipfKjU="
}

Retrieve a Business Data Task

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

Example Request

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

Example Response

Copy
{
  "status": "success",
  "message": [
    {
      "id": "1",
      "search_parameters": "{\"category\":\"Property management company\",\"location\":\"Austin, TX\"}",
      "cache_file": "ea66bf0b769c7b323292a8f0aca52299.bd",
      "api_type": "google_places",
      "geo_code_status": "1",
      "image_import_status": "1",
      "user_actions_status": "0",
      "start_date": "2024-06-13 17:55:55",
      "complete_date": "2024-06-13 16:55:58",
      "total_records": "4"
    }
  ],
  "total": "1",
  "current_page": 1,
  "total_pages": 1
}

Create a Business Data Task

POST /api/v2/business_data_api_task/create

Example Request

Copy
curl -X POST "https://www.yourdomain.com/api/v2/business_data_api_task/create" \
  -H "X-Api-Key: your-api-key-here" \
  -d "search_parameters={\"category\":\"Restaurant\",\"location\":\"Chicago, IL\"}" \
  -d "cache_file=abc123.bd" \
  -d "api_type=google_places" \
  -d "geo_code_status=0" \
  -d "image_import_status=0" \
  -d "user_actions_status=0" \
  -d "total_records=0"

Example Response

Copy
{
  "status": "success",
  "message": {
    "id": "22",
    "search_parameters": "{\"category\":\"Restaurant\",\"location\":\"Chicago, IL\"}",
    "cache_file": "abc123.bd",
    "api_type": "google_places",
    "geo_code_status": "0",
    "image_import_status": "0",
    "user_actions_status": "0",
    "start_date": null,
    "complete_date": null,
    "total_records": "0"
  }
}

Update a Business Data Task

PUT /api/v2/business_data_api_task/update

Example Request

Copy
curl -X PUT "https://www.yourdomain.com/api/v2/business_data_api_task/update" \
  -H "X-Api-Key: your-api-key-here" \
  -d "id=22" \
  -d "user_actions_status=1" \
  -d "total_records=15"

Example Response

Copy
{
  "status": "success",
  "message": {
    "id": "22",
    "search_parameters": "{\"category\":\"Restaurant\",\"location\":\"Chicago, IL\"}",
    "cache_file": "abc123.bd",
    "api_type": "google_places",
    "geo_code_status": "0",
    "image_import_status": "0",
    "user_actions_status": "1",
    "start_date": "0000-00-00 00:00:00",
    "complete_date": "0000-00-00 00:00:00",
    "total_records": "15"
  }
}

Delete a Business Data Task

DELETE /api/v2/business_data_api_task/delete

Example Request

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

Example Response

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