Retrieves information about visit activity within a specified time range. The API supports optional filtering by task IDs and user ID.
Request
Endpoint
POST https://yourdomain.pharmahrm.com/crm-api/db-function/run
Authentication
Bearer Token required
Request Structure
Headers
| Key | Value |
|---|---|
| Authorization | Bearer <token>
|
| Content-Type | application/json |
Request Body
{
"function": "api_get_tasks",
"format": "csv",
"arguments": {
"date_from": "2025-08-04",
"date_till": "2025-08-04",
"ids": "1,2,3,4",
"user_id": 1
}
}| Name | Type | Required | Description |
|---|---|---|---|
| function | string | Yes | The name of the API method. Use "api_get_tasks" for this call. |
| format | string | Yes | The response format - csv |
| arguments | object | Yes | Parameters block |
| date_from | string | Yes | Start date of the reporting period (visit start date). Format: YYYY-MM-DD
|
| date_till | string | Yes | End date of the reporting period (visit end date). Format: YYYY-MM-DD
|
| ids | string | Optional | Comma-separated list of visit (task) IDs from Proxima CRM. |
| user_id | integer | Optional | Proxima CRM user ID. Returns visits for a specific user. |
Successful Response
200 OK
Format
Plain text CSV
Content-Type
text/plain
Example Response
task_id,task_datefrom,task_datetill,task_gmt_offset,task_type,task_user_id,task_user2_id,task_company_id,task_contact_id,task_target,task_spec,task_taskstate,task_created,task_fact_start,task_fact_end,task_dist,task_gps_lng,task_gps_lat
1234,2025-08-04T08:00:00Z,2025-08-04T08:30:00Z,180,Visit,5,,101,201,A,Cardiologist,Done,2025-08-03T12:15:00Z,2025-08-04T08:03:00Z,2025-08-04T08:28:00Z,0.5,30.5238,50.4501
| Field | Description |
|---|---|
| task_id | Visit ID in the Proxima CRM database |
| task_datefrom | Scheduled visit start date and time (UTC). Format: YYYY-MM-DD HH:MM:SS |
| task_datetill | Scheduled visit end date and time (UTC). Format: YYYY-MM-DD HH:MM:SS |
| task_gmt_offset | Offset from UTC in minutes |
| task_type | Type of visit |
| task_user_id | ID of the executor (user) from Proxima CRM |
| task_user2_id | ID of the observer/subordinate (if any) |
| task_company_id | Institution ID in Proxima CRM |
| task_contact_id | Client ID in Proxima CRM |
| task_target | Target group of the visit |
| task_spec | Client's specialization indicated during the visit |
| task_taskstate | Visit status (e.g., Planned, Done, Cancelled) |
| task_created | Date and time the task was created (UTC). Format: YYYY-MM-DD HH:MM:SS |
| task_fact_start | Actual visit start time (UTC) |
| task_fact_end | Actual visit end time (UTC) |
| task_dist | Distance of visit closure (in km or meters, depending on config) |
| task_gps_lng | Longitude of the closure GPS coordinate |
| task_gps_lat | Latitude of the closure GPS coordinate |
Error Responses
40x/50x
{
"message": "string"
}| Code | Meaning |
|---|---|
| 400 | Bad request (e.g., missing required parameters) |
| 401 | Unauthorized (invalid or missing token) |
| 500 | Internal server error |