ממשקי API
CRM API Documentation
This documentation covers the core CRM endpoints: get_data.php, set_data.php, and set_status.php.
1) get_data.php - by phone
- Purpose
Retrieve customer or repository data by DID and phone number.
- Method
GET
- Authorization Required
Yes (authkey): Mindc_2023_get_data
Parameters
| Parameter | Required | Description |
|---|---|---|
authkey |
✅ | Authentication key: Mindc_2023_get_data |
did |
✅ | Incoming DID number |
phone |
✅ | Customer phone number |
out |
✅ | Comma-separated list of output fields |
project_id |
⚠️* | Project ID |
worker_id |
⚠️* | Worker ID (used to resolve project) |
group_id |
❌ | Filter by group |
repository_id |
❌ | Filter by repository |
site_id |
❌ | Filter by site |
⚠️ At least one of project_id or worker_id is required.
Special out Fields
You may request the following:
last_statuslast_calllast_notesrepository_idrepository_namerepository_assign_id- Any customer field from the Forms module
Example Requests
GET /api/get_data.php?authkey=Mindc_2023_get_data&did=07333333333&phone=0500000000&project_id=10&out=first_name,last_status,repository_name
GET /api/get_data.php?authkey=Mindc_2023_get_data&repository_assign_id=2190811&out=uid,repository_name,customer_name
Success Response
{
"code": 0,
"status": "success",
"message": [
{
"uid": "123",
"name": "John Doe",
"email": "john@mail.com",
"last_status": "Interested"
}
]
}
Or empty results:
{
"code": 0,
"status": "success",
"message": []
}
Failure Response
{
"code": 3,
"status": "fail",
"message": "Missing phone"
}
Error Codes
| Code | Meaning |
|---|---|
| 1 | Missing or invalid authkey |
| 2 | Missing DID |
| 3 | Missing phone |
| 4 | Missing out parameter
|
| 5 | Missing both project_id and worker_id |
| 6 | No matching repository assign |
| 7 | Database exception |
2) get_data.php - by phone
- Purpose
Retrieve customer or repository data by repository_assign_id value
- Method
GET
- Authorization Required
Yes (authkey): Mindc_2023_get_data
Parameters
| Parameter | Required | Description |
|---|---|---|
authkey |
✅ | Authentication key: Mindc_2023_get_data |
repository_id |
✅ | Filter by repository |
out |
✅ | Comma-separated list of output fields |
project_id |
⚠️* | Project ID |
worker_id |
⚠️* | Worker ID (used to resolve project) |
group_id |
❌ | Filter by group |
site_id |
❌ | Filter by site |
Special out Fields
You may request the following:
last_statuslast_calllast_notesrepository_idrepository_namerepository_assign_id- Any customer field from the Forms module
Example Requests
GET /api/get_data.php?authkey=Mindc_2023_get_data&repository_assign_id=2190811&out=uid,repository_name,customer_name
Success Response
{
"code": 0,
"status": "success",
"message": [
{
"uid": "123",
"name": "John Doe",
"email": "john@mail.com",
"last_status": "Interested"
}
]
}
Or empty results:
{
"code": 0,
"status": "success",
"message": []
}
Failure Response
{
"code": 3,
"status": "fail",
"message": "Missing phone"
}
Error Codes
| Code | Meaning |
|---|---|
| 1 | Missing or invalid authkey |
| 2 | Missing DID |
| 3 | Missing phone |
| 4 | Missing out parameter
|
| 5 | Missing both project_id and worker_id |
| 6 | No matching repository assign |
| 7 | Database exception |
3) set_data.php
- Purpose
Update customer fields and/or status.
- Method
GET or POST
- Authorization Required
Yes (authkey): Mindc_2023_set_data
Parameters
| Parameter | Required | Description |
|---|---|---|
authkey |
✅ | Authentication key: Mindc_2023_set_data |
repository_assign_id |
⚠️* | Direct repository assign ID |
project_id |
⚠️* | Project ID (used if repository_assign_id not provided)
|
worker_id |
⚠️* | Worker ID (used if repository_assign_id not provided)
|
phone |
⚠️** | Customer phone (required if not using repository_assign_id)
|
did |
⚠️** | DID number (required if not using repository_assign_id)
|
group_id |
❌ | Filter for lookup |
repository_id |
❌ | Filter for lookup |
site_id |
❌ | Filter for lookup |
status_id |
❌ | Status ID to set |
| Any field name | ❌ | Any valid customer field (use display_name)
|
⚠️ Either repository_assign_id OR (project_id + worker_id + phone + did) is required.
⚠️ phone and did are required if not using repository_assign_id.
Example Requests
Update Customer Data (Using repository_assign_id)
POST /dev-6/api/set_data.php | authkey=Mindc_2023_set_data&repository_assign_id=555&first_name=Jane&email=jane@example.com
Content-Type: application/x-www-form-urlencoded
Update Status Only (Using Phone & Project Context)
GET /dev-6/api/set_data.php?authkey=Mindc_2023_set_data&did=123456&phone=972500000000&project_id=15&status_id=10
Update Data and Status Together (with worker_id)
POST /dev-6/api/set_data.php | authkey=Mindc_2023_set_data&repository_assign_id=555&city=New York&status_id=2&worker_id=99
Success Responses
- Fields Updated
{
"code": 0,
"status": "success",
"message": "email was updated to 'a@mail.com', name was updated to 'Anna'"
}
- Only Status Updated
{
"code": 0,
"status": "success",
"message": "Status set successfully"
}
- Partial Success
{
"code": 0,
"status": "success",
"message": "Fields updated",
"errors": {
"status": "Failed to set status"
}
}
Error Codes
| Code | Meaning |
|---|---|
| 1 | Missing or invalid authkey |
| 2 | Missing repository assign ID |
| 3 | Invalid repository assign ID |
| 4 | Duplicate unique field |
| 5 | Update failed |
| 6 | No valid fields or repository not found |
| 7 | No fields provided in request |
4) set_status.php
- Purpose
Set or clear customer status for a repository assign.
- Method
GET or POST
- Authorization Required
Yes (authkey): Mindc_2023_set_status
Parameters
| Parameter | Required | Description |
|---|---|---|
authkey |
✅ | Authentication key: Mindc_2023_set_status |
repository_assign_id |
✅ | Repository assign ID |
status_id |
✅ | Status ID (or 0 = clear status)
|
worker_id |
❌ | Worker ID (for audit purposes) |
Example Requests
Set Status for a Customer
GET /dev-6/api/set_status.php?authkey=Mindc_2023_set_status&repository_assign_id=555&status_id=10
Clear Status
POST /dev-6/api/set_status.php | authkey=Mindc_2023_set_status&repository_assign_id=555&status_id=0
Content-Type: application/x-www-form-urlencoded
Success Response
{
"code": 0,
"status": "success",
"message": "Status set successfully"
}
Error Codes
| Code | Meaning |
|---|---|
| 1 | Missing or invalid authkey |
| 2 | Missing repository assign ID |
| 3 | Invalid repository assign ID |
| 4 | Missing status ID |
| 5 | Failed to set status |