Batch Polling
Batch compliance review jobs are processed asynchronously. Monitor progress with polling.
Workflow
Upload file → Poll status → Retrieve results → Export CSV
Polling implementation
import time
import requests
BASE_URL = "https://api.awardsintelligence.com.au/api/v1"
headers = {"Authorization": f"Bearer {API_KEY}:{API_SECRET}"}
# 1. Upload
with open("payroll.csv", "rb") as f:
upload = requests.post(
f"{BASE_URL}/batches/upload",
headers={"Authorization": headers["Authorization"]},
files={"file": f},
)
batch_id = upload.json()["batch_id"]
print(f"Batch {batch_id} uploaded")
# 2. Poll
while True:
status = requests.get(
f"{BASE_URL}/batches/{batch_id}",
headers=headers,
).json()
print(f"Status: {status['status']} "
f"({status['processed_rows']}/{status['total_rows']})")
if status["status"] in ("complete", "failed", "cancelled"):
break
time.sleep(3)
# 3. Retrieve results
if status["status"] == "complete":
results = requests.get(
f"{BASE_URL}/batches/{batch_id}/results?limit=100",
headers=headers,
).json()
for row in results["rows"]:
print(f"Row {row['row_index']}: "
f"{row['row_status']} — "
f"${row['pay_output']['gross_pay']:.2f}")
Status values
| Status | Meaning | Action |
|---|---|---|
queued | Waiting to start | Keep polling |
processing | In progress | Keep polling — check processed_rows for progress |
complete | Finished | Retrieve results |
failed | Processing error | Check error_message for details |
cancelled | Cancelled by user | Results for already-processed rows are retained |
Polling interval
- Recommended: 3–5 seconds
- Minimum: 1 second
- Small files (<100 rows) typically complete in under 10 seconds
- Large files (10,000+ rows) may take several minutes
Webhooks
Webhook notifications are not yet available. Use polling for now.