Get Job Status
Monitor the processing status of enrichment and extraction jobs to track progress and determine when results are ready.
Endpoint: GET https://api.walkerstdata.com.au/v1/jobs/{jobId}/status
Request
- cURL
- JavaScript
- Python
curl -X GET "https://api.walkerstdata.com.au/v1/jobs/550e8400-e29b-41d4-a716-446655440000/status" \
-H "x-api-key: YOUR_API_KEY"
const jobId = '550e8400-e29b-41d4-a716-446655440000';
const response = await fetch(`https://api.walkerstdata.com.au/v1/jobs/${jobId}/status`, {
method: 'GET',
headers: {
'x-api-key': 'YOUR_API_KEY',
},
});
const result = await response.json();
const status = result.data.status;
console.log('Job status:', status);
import requests
job_id = '550e8400-e29b-41d4-a716-446655440000'
response = requests.get(
f'https://api.walkerstdata.com.au/v1/jobs/{job_id}/status',
headers={'x-api-key': 'YOUR_API_KEY'}
)
result = response.json()
status = result['data']['status']
print(f'Job status: {status}')
Response Examples
New Job
{
"data": {
"jobId": "550e8400-e29b-41d4-a716-446655440000",
"status": "New",
"message": "",
"type": "Enrichment",
"totalReceivedTransactions": 100,
"totalProcessedTransactions": 0
},
"message": null
}
Processing Job
{
"data": {
"jobId": "550e8400-e29b-41d4-a716-446655440000",
"status": "Processing",
"message": "",
"type": "Enrichment",
"totalReceivedTransactions": 100,
"totalProcessedTransactions": 45
},
"message": null
}
Completed Job
{
"data": {
"jobId": "550e8400-e29b-41d4-a716-446655440000",
"status": "Completed",
"message": "",
"type": "Enrichment",
"totalReceivedTransactions": 100,
"totalProcessedTransactions": 100
},
"message": null
}
Failed Job
{
"data": {
"jobId": "550e8400-e29b-41d4-a716-446655440000",
"status": "Failed",
"message": "Processing error: Invalid transaction format",
"type": "Enrichment",
"totalReceivedTransactions": 100,
"totalProcessedTransactions": 0
},
"message": null
}
Response Fields
| Field | Description | When Present |
|---|---|---|
| jobId | Unique identifier for the job | Always |
| status | Current processing state: New, Processing, Completed, Failed | Always |
| message | Status message or error description (empty string on success) | Always |
| type | Job type: Enrichment or Extraction | Always |
| totalReceivedTransactions | Total number of transactions submitted in the batch | Always |
| totalProcessedTransactions | Number of transactions successfully processed | Always |
Polling Pattern
For monitoring job progress, you may wish to implement a polling strategy:
- JavaScript
- Python
const pollJobStatus = async (jobId, maxAttempts = 60, intervalMs = 5000) => {
for (let attempt = 0; attempt < maxAttempts; attempt++) {
const response = await fetch(`https://api.walkerstdata.com.au/v1/jobs/${jobId}/status`, {
headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const result = await response.json();
const status = result.data.status;
if (status === 'Completed') {
console.log('Job completed successfully!');
return result.data;
} else if (status === 'Failed') {
throw new Error(`Job failed: ${result.data.message || 'Unknown error'}`);
}
console.log(`Job status: ${status}, waiting...`);
await new Promise(resolve => setTimeout(resolve, intervalMs));
}
throw new Error('Job polling timeout');
};
// Usage
try {
const completedJob = await pollJobStatus('550e8400-e29b-41d4-a716-446655440000');
console.log('Total processed transactions:', completedJob.totalProcessedTransactions);
} catch (error) {
console.error('Job monitoring failed:', error.message);
}
import requests
import time
def poll_job_status(job_id, max_attempts=60, interval_seconds=5):
"""Poll job status until completion or failure"""
for attempt in range(max_attempts):
response = requests.get(
f'https://api.walkerstdata.com.au/v1/jobs/{job_id}/status',
headers={'x-api-key': 'YOUR_API_KEY'}
)
result = response.json()
status = result['data']['status']
if status == 'Completed':
print('Job completed successfully!')
return result['data']
elif status == 'Failed':
error_msg = result['data'].get('message', 'Unknown error')
raise Exception(f'Job failed: {error_msg}')
print(f'Job status: {status}, waiting...')
time.sleep(interval_seconds)
raise Exception('Job polling timeout')
# Usage
try:
completed_job = poll_job_status('550e8400-e29b-41d4-a716-446655440000')
print(f"Total processed transactions: {completed_job.get('totalProcessedTransactions', 'N/A')}")
except Exception as error:
print(f'Job monitoring failed: {error}')
Use Cases
- Progress monitoring: Track enrichment or extraction job progress
- Workflow coordination: Determine when to retrieve processed results
- Error handling: Detect and respond to processing failures
- Performance metrics: Analyze job processing times and success rates
Next Steps
When a job shows Completed status:
- Retrieve results: Get enriched transactions using the job ID
- Analyze data: Process the categorized transaction data
- Handle errors: For failed jobs, review error details and retry if appropriate