API Guide

All data
All data/No filters applied

How the class pipeline reaches this dashboard

The job chain each student builds in Control-M

  1. Database

    Query extract

  2. File Transfer

    Move the export

  3. Transform

    Shape the records

  4. REST API

    ingestData

  5. Dashboard

    Live refresh

Endpoints

POST only. Both paths answer the same way.

Load a batch

POST https://your-app-url/functions/ingestData

Alias: POST https://your-app-url/api/ingestData

Verify a batch

POST https://your-app-url/functions/ingestStatus

Alias: POST https://your-app-url/api/ingestStatus

Headers

Every call needs both

Content-Type: application/json

Required. The body must be a JSON object.

x-api-key: your ingest key

Set by the instructor in the app secrets as INGEST_API_KEY. The key is never shown in this app or in any log. If it is not set, every call is rejected.

Limits

500 records and 1 MB per call. Body fields batch_id and submitted_by: letters, numbers, underscore or hyphen, up to 40 characters.

Sample request bodies

Valid payloads for each dataset. Download one and post it with the job.

json
{
  "dataset": "sales",
  "batch_id": "QDV_SALES_001",
  "submitted_by": "QDV",
  "records": [
    {
      "sale_id": "S-100001",
      "sale_date": "2026-11-20",
      "country_code": "TW",
      "category": "HP Servers",
      "product_id": "HPE-DL380G11",
      "product_name": "HPE ProLiant DL380 Gen11",
      "quantity": 4,
      "revenue": 5200,
      "cost": 3380,
      "channel": "Online",
      "salesperson": "A. Tan"
    },
    {
      "sale_id": "S-100002",
      "sale_date": "2026-11-20",
      "country_code": "SG",
      "category": "Switches Hubs & Cabling",
      "product_id": "SWC-ARU6100-48",
      "product_name": "Aruba 6100 48G Switch",
      "quantity": 10,
      "revenue": 3100,
      "cost": 2015,
      "channel": "Reseller",
      "salesperson": "J. Lim"
    }
  ]
}
FieldTypeReqRule
sale_idstringYesUnique per submitted_by. Re-sending updates the row.
sale_datedateYesYYYY-MM-DD
country_codeenumYesTW, ID, VN, TH, MY, PH, SG
categoryenumYesHP Servers, Dell Servers, Network Devices, Firewalls, Server Racks, Switches Hubs & Cabling, UPS & Power
product_idstringYesProduct code
product_namestringNoDisplay name
quantitynumberYes0 or more
revenuenumberYesUSD, 0 or more
costnumberYesUSD, 0 or more
channelenumYesReseller, System Integrator, Enterprise, Online
salespersonstringYesFree text

Windows curl job

Store the key in an environment variable, never in the job body

cmd
curl.exe --fail-with-body -X POST "https://your-app-url/functions/ingestData" ^
  -H "Content-Type: application/json" ^
  -H "x-api-key: %ORBIT_API_KEY%" ^
  --data-binary "@C:\temp\sales.json"
bash
curl --fail-with-body -X POST "https://your-app-url/functions/ingestData" \
  -H "Content-Type: application/json" \
  -H "x-api-key: $ORBIT_API_KEY" \
  --data-binary "@./sales.json"

Set the variable once on the machine that runs the job: setx ORBIT_API_KEY "your-ingest-key" on Windows, then use %ORBIT_API_KEY% in the command. --fail-with-body makes Control-M mark the job as failed when the API returns 4xx or 5xx.

Responses

Errors are explicit so a job fails clearly

200 success

json
{
  "success": true,
  "batch_id": "QDV_SALES_001",
  "dataset": "sales",
  "received": 2,
  "inserted": 2,
  "updated": 0,
  "rejected": 0
}

400 validation

json
{
  "success": false,
  "error": "Validation failed. No records were saved.",
  "details": [
    {
      "record": 2,
      "field": "country_code",
      "reason": "must be one of TW, ID, VN, TH, MY, PH, SG"
    }
  ]
}
  • 401: missing or wrong x-api-key, or the key secret is not set.
  • 400: any invalid record, or a repeated key inside the batch. Nothing is saved.
  • 405: wrong HTTP method. 413: body over 1 MB. 500: the write failed, so re-send the same batch.

Verification job

Call ingestStatus after ingestData to prove the batch landed

cmd
curl.exe --fail-with-body -X POST "https://your-app-url/functions/ingestStatus" ^
  -H "Content-Type: application/json" ^
  -H "x-api-key: %ORBIT_API_KEY%" ^
  -d "{\"batch_id\":\"QDV_SALES_001\"}"

The response repeats the batch result: received, inserted, updated, rejected and status. Re-sending the same batch is safe: rows are matched on their key and updated instead of duplicated.

Ready to test from this browser?

Fictional training data - Orbit Hardware Distributor Command Center