Description
This endpoint checks the current status of a previously submitted data generation job. It returns the status code and additional information about the job, such as batch count (for JSON responses).
Endpoint
GET https://yourdomain.pharmahrm.com/crm-api/db-function/status/{{job_id}}
Authentication
Bearer Token (required)
Request
Headers
| Key | Value |
|---|---|
| Authorization | Bearer <token>
|
| Content-Type |
application/json (optional) |
Path Parameter
| Parameter | Type | Required | Description |
|---|---|---|---|
| job_id | integer | Yes | Unique identifier of the submitted job |
Body
No request body is required.
Successful Response
200 OK
{
"id": 39,
"status": 3,
"batch_count": null
}Response Fields
| Field | Type | Description |
|---|---|---|
| id | integer | Job ID — the identifier of the submitted task |
| status | integer | Current status of the job (see status codes below) |
| batch_count | integer or null | Number of data batches (only applicable for JSON format; one batch = 500 records) |
Job Status Codes
| Code | Status | Description |
|---|---|---|
| 1 | Pending | Job is waiting in the queue for execution |
| 2 | Running | Job is currently in progress |
| 3 | Finished | Job completed successfully |
| 4 | Error | An error occurred during execution |
Error Responses
40x / 50x
{
"message": "Error message string"
}| Code | Description |
|---|---|
| 400-499 | Client errors (e.g., invalid job ID) |
| 500–599 | Server errors |