Description
This endpoint triggers a data generation task. The request supports optional parameters and allows results in either JSON or CSV format. The system processes the request asynchronously and returns a job ID for tracking.
Endpoint
POST https://yourdomain.pharmahrm.com/crm-api/db-function/run
Authentication
Bearer Token (required)
Request
Headers
| Key | Value |
|---|---|
| Authorization | Bearer <token>
|
| Content-Type | application/json |
Body
{
"function": "api_get_tasks",
"format": "csv",
"arguments": {
"id": "123"
}
}
Parameters
| Field | Type | Required | Description |
|---|---|---|---|
| function | string | Yes | The backend method to call for data generation (e.g., api_get_tasks) |
| format | string | Yes | Desider format for the response data. Accepts “json” or “csv” |
| arguments | objects | No | Optional parameters required by specific functions (e.g., task ID) |
Responses
Successful Response
200 OK
{
"job_id": 39
}
| Field | Type | Description |
|---|---|---|
| job_id | integer | Unique identifier for the submitted data generation job |
Use this job_id to retrieve job status and download results using other endpoints
Error Responses
4xx / 5xx
{
"message": "Error message string"
}
| Code | Descripton |
|---|---|
| 400 - 499 | Client errors (e.g., invalid input) |
| 500 - 599 | Server errors |