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_json",
"format": "json",
"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_json" for this call. |
| format | string | Yes | The response format - json |
| 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
JSON
Example Response
[{"task_id":48313,
"task_datefrom":"2025-08-01T12:30:00",
"task_datetill":"2025-08-01T13:00:00",
"task_gmt_offset":10800,
"task_type":"Дзвінок лікарю",
"task_user_id":38,
"task_user2_id":38,
"task_company_id":41016,
"task_contact_id":36242,
"task_target":[
"Rx-Сімейний лікар"
],
"task_spec":"Загальна практика - сімейна медицина (поликлиника)",
"task_taskstate":"Виконаний",
"task_created":"2025-07-05T22:47:51",
"task_fact_start":"2025-08-01T11:20:15",
"task_fact_end":"2025-08-01T13:27:14",
"task_dist":null,
"task_gps_lng":null,
"task_gps_lat":null}]| 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 |