Skip to content

Business Intelligence API

Overview

The Business Intelligence (BI) API provides RPC-style operations, task scheduling, email services, and business workflow utilities.

Base Endpoint: /bi

API Endpoints

1. RPC Call

Execute remote procedure call operations.

Endpoint: POST /bi/rpc/call

Parameters:

ParameterTypeRequiredDescription
methodStringYesRPC method name
paramsObjectYesMethod parameters
idStringNoRequest identifier
timeoutIntegerNoTimeout in milliseconds (default: 30000)

Request:

bash
curl -X POST "https://api.alaikis.com/std/bi/rpc/call" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -d "bizContent={\"method\": \"getAnalyticsReport\", \"params\": {\"reportType\": \"sales\", \"dateRange\": \"2026-05\"}}"

Response:

json
{
  "code": 200,
  "msg": "Request successful",
  "data": {
    "jsonrpc": "2.0",
    "id": "req-12345",
    "result": {
      "reportType": "sales",
      "period": "2026-05",
      "totalRevenue": 125450.75,
      "currency": "USD",
      "transactions": 842,
      "avgOrderValue": 148.99
    }
  },
  "timestamp": 1715385600
}

2. Batch RPC Call

Execute multiple RPC operations in a single request.

Endpoint: POST /bi/rpc/batch

Parameters:

ParameterTypeRequiredDescription
callsArrayYesArray of RPC call objects
parallelBooleanNoExecute in parallel (default: false)

Request:

bash
curl -X POST "https://api.alaikis.com/std/bi/rpc/batch" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -d "bizContent={\"calls\": [{\"method\": \"getUserStats\", \"params\": {}}, {\"method\": \"getRevenue\", \"params\": {\"days\": 7}}], \"parallel\": true}"

3. Schedule Task

Schedule a recurring task using celery-style scheduling.

Endpoint: POST /bi/scheduler/create

Parameters:

ParameterTypeRequiredDescription
taskNameStringYesTask identifier
scheduleObjectYesSchedule definition (cron or interval)
endpointStringYesWebhook endpoint URL
payloadObjectNoTask payload data
enabledBooleanNoEnable immediately (default: true)

Request:

bash
curl -X POST "https://api.alaikis.com/std/bi/scheduler/create" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -d "bizContent={\"taskName\": \"daily-sales-report\", \"schedule\": {\"cron\": \"0 9 * * *\"}, \"endpoint\": \"https://your-api.com/webhook/report\"}"

Response:

json
{
  "code": 200,
  "msg": "Request successful",
  "data": {
    "taskId": "task-abc123xyz",
    "taskName": "daily-sales-report",
    "schedule": {"cron": "0 9 * * *", "timezone": "UTC"},
    "nextRun": "2026-05-12T09:00:00Z",
    "status": "active",
    "createdAt": "2026-05-11T02:30:00Z"
  },
  "timestamp": 1715385600
}

4. List Scheduled Tasks

Get all scheduled tasks with status.

Endpoint: POST /bi/scheduler/list

Parameters:

ParameterTypeRequiredDescription
statusStringNoFilter by status: active, paused, completed
limitIntegerNoResult limit (default: 50)

Request:

bash
curl -X POST "https://api.alaikis.com/std/bi/scheduler/list" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -d "bizContent={\"status\": \"active\"}"

5. Get Task Execution History

Retrieve execution history for a scheduled task.

Endpoint: POST /bi/scheduler/history

Parameters:

ParameterTypeRequiredDescription
taskIdStringYesTask identifier
limitIntegerNoResult limit (default: 20)

Request:

bash
curl -X POST "https://api.alaikis.com/std/bi/scheduler/history" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -d "bizContent={\"taskId\": \"task-abc123xyz\"}"

6. Pause/Resume Task

Control task execution status.

Endpoint: POST /bi/scheduler/status

Parameters:

ParameterTypeRequiredDescription
taskIdStringYesTask identifier
actionStringYesAction: pause, resume, cancel

Request:

bash
curl -X POST "https://api.alaikis.com/std/bi/scheduler/status" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -d "bizContent={\"taskId\": \"task-abc123xyz\", \"action\": \"pause\"}"

7. Send Email

Send transactional or marketing emails.

Endpoint: POST /bi/email/send

Parameters:

ParameterTypeRequiredDescription
toArrayYesRecipient email addresses
subjectStringYesEmail subject
bodyStringYesEmail body (HTML or plain text)
fromStringNoSender email (default: system)
ccArrayNoCC recipients
bccArrayNoBCC recipients
attachmentsArrayNoEmail attachments
templateIdStringNoTemplate identifier
templateDataObjectNoTemplate merge data

Request:

bash
curl -X POST "https://api.alaikis.com/std/bi/email/send" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -d "bizContent={\"to\": [\"user@example.com\"], \"subject\": \"Order Confirmation\", \"body\": \"<h1>Thank you!</h1>\"}"

Response:

json
{
  "code": 200,
  "msg": "Request successful",
  "data": {
    "messageId": "msg-789xyz",
    "status": "queued",
    "recipients": 1,
    "queuedAt": "2026-05-11T02:30:00Z",
    "estimatedDelivery": "2026-05-11T02:30:05Z"
  },
  "timestamp": 1715385600
}

8. Email Status

Check delivery status of sent emails.

Endpoint: POST /bi/email/status

Parameters:

ParameterTypeRequiredDescription
messageIdStringYesMessage identifier

Request:

bash
curl -X POST "https://api.alaikis.com/std/bi/email/status" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -d "bizContent={\"messageId\": \"msg-789xyz\"}"

Response:

json
{
  "code": 200,
  "msg": "Request successful",
  "data": {
    "messageId": "msg-789xyz",
    "status": "delivered",
    "deliveredAt": "2026-05-11T02:30:03Z",
    "opened": true,
    "openedAt": "2026-05-11T02:35:12Z",
    "clicked": false,
    "bounced": false
  },
  "timestamp": 1715385600
}

9. Verify Email (Advanced)

Advanced email verification with detailed diagnostics.

Endpoint: POST /bi/email/verify-advanced

Parameters:

ParameterTypeRequiredDescription
emailStringYesEmail address
deepCheckBooleanNoPerform deep SMTP check (default: true)
catchAllTestBooleanNoTest for catch-all domain (default: true)

Request:

bash
curl -X POST "https://api.alaikis.com/std/bi/email/verify-advanced" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -d "bizContent={\"email\": \"support@alaikis.com\", \"deepCheck\": true}"

10. Generate Report

Generate business intelligence reports.

Endpoint: POST /bi/report/generate

Parameters:

ParameterTypeRequiredDescription
reportTypeStringYesReport type: sales, users, inventory, financial
parametersObjectYesReport parameters
formatStringNoOutput format: json, csv, pdf, xlsx (default: json)
scheduleStringNoSchedule: now, daily, weekly, monthly

Request:

bash
curl -X POST "https://api.alaikis.com/std/bi/report/generate" \
  -H "X-API-Key: your_api_key" \
  -H "X-API-Secret: your_api_secret" \
  -d "bizContent={\"reportType\": \"sales\", \"parameters\": {\"startDate\": \"2026-05-01\", \"endDate\": \"2026-05-10\"}, \"format\": \"xlsx\"}"

Schedule Format

Cron Expression

┌───────────── minute (0 - 59)
│ ┌───────────── hour (0 - 23)
│ │ ┌───────────── day of month (1 - 31)
│ │ │ ┌───────────── month (1 - 12)
│ │ │ │ ┌───────────── day of week (0 - 6) (Sunday=0)
│ │ │ │ │
* * * * *

Interval Format

json
{"minutes": 30}
{"hours": 4}
{"days": 1}
{"weeks": 1}

Email Attachment Format

json
{
  "filename": "report.pdf",
  "contentType": "application/pdf",
  "contentBase64": "JVBERi0xLjMKJcfs..."
}

Rate Limiting

  • RPC Calls: 1000 requests/hour
  • Scheduler Operations: 100 requests/hour
  • Email Sending: 500 emails/hour
  • Report Generation: 50 reports/hour

Task Statuses

StatusDescription
pendingTask created and waiting
activeTask is scheduled and running
pausedTask execution suspended
completedTask finished successfully
failedTask execution failed
cancelledTask manually cancelled

Support

Contact: support@alaikis.com