Function returns leads. Without parameters all leads are returned; the result can be filtered, searched, sorted and paged
https://rest.crmango.com/api/GetAllLeads
Bearer
varchar
Auth token
lead_id
integer
Returns only the lead with this id
search
varchar
Searched text: lead name, company, company id, person name, e-mail, phone or note. More words = all must match
priority
integer
Only leads with this priority
Options: 1, 2 or 3
product_id
integer
Only leads of this product/service
company_mango_id
integer
Only leads linked to this company
person_mango_id
integer
Only leads linked to this person
contacted
integer
1 = only contacted leads, 0 = only not yet contacted leads
date_type
varchar
Which date is filtered by date_from/date_to
Options: creation_date (default) or last_updated
date_from
integer
Unix timestamp, from
date_to
integer
Unix timestamp, to
sort_by
varchar
Sort column
Options: lead_id (default), creation_date, last_updated, lead_name, when_contact_date, priority
sort_dir
varchar
Sort direction
Options: asc (default) or desc
limit
integer
Number of returned leads (max 10000, default 10000)
page
integer
Page number starting from 0
Function returns leads
lead_id
integer
Lead ID
lead_name
varchar
Lead name
creation_date
timestamp
Created date
last_updated
timestamp
Updated date
when_contact_date
date
Date when to contact the lead
contacted_date
date
Date when the lead was contacted
lead_creator
integer
User which created lead <br> Reference: <a href="https://rest.crmango.com/documentation/GetAllUsers/detail" target="_blank"> GetAllUsers </a>
lead_assignee
integer
Assigned user, 0 = unassigned <br> Reference: <a href="https://rest.crmango.com/documentation/GetAllUsers/detail" target="_blank"> GetAllUsers </a>
company_id
varchar
Company id (IČO)
company_mango_id
integer
Company id in Mango <br> Reference: <a href="https://rest.crmango.com/documentation/GetAllCompanies/detail" target="_blank"> GetAllCompanies </a>
company_name
varchar
Company name
company_country_id
integer
Country id <br> Reference: <a href="https://rest.crmango.com/documentation/GetAllStates/detail" target="_blank"> GetAllStates </a>
company_country
varchar
Country ISO2 code
company_address
varchar
Company address
company_postal
varchar
Company postal
person_name
varchar
Person name
person_surname
varchar
Person surname
person_phone
varchar
Person phone number
person_email
varchar
Person e-mail
person_mango_id
integer
Person id in Mango <br> Reference: <a href="https://rest.crmango.com/documentation/GetAllPersons/detail" target="_blank"> GetAllPersons </a>
lead_status_id
integer
Lead status id <br> Reference: <a href="https://rest.crmango.com/documentation/GetAllLists/detail" target="_blank"> GetAllLists </a>
lead_source_id
integer
Lead source id <br> Reference: <a href="https://rest.crmango.com/documentation/GetAllLists/detail" target="_blank"> GetAllLists </a>
lead_campaign_id
integer
Lead campaign id <br> Reference: <a href="https://rest.crmango.com/documentation/GetAllLists/detail" target="_blank"> GetAllLists </a>
priority
integer
Priority <br> Options: 1, 2 or 3
lead_note
varchar
Note
product_id
integer
Id of active product/service
curl --request GET \
--url 'https://rest.crmango.com/api/GetAllLeads' \
--header 'Authorization: Bearer auth_token'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://rest.crmango.com/api/GetAllLeads',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer auth_token'
),
));
$response = curl_exec($curl);
echo $response;
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://rest.crmango.com/api/GetAllLeads");
xhr.setRequestHeader("Authorization", "Bearer auth_token");
xhr.send();
import requests
url = "https://rest.crmango.com/api/GetAllLeads"
payload = {}
headers = {
'Authorization': 'Bearer auth_token'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
{
"code": 200,
"response": [
{
"lead_id": 149,
"lead_name": "Novy lead zo stranky (crmango.com)",
"creation_date": "2022-12-01 14:58:06",
"last_updated": "2022-12-01 14:58:06",
"when_contact_date": "0000-00-00",
"contacted_date": "0000-00-00",
"lead_creator": 0,
"lead_assignee": 0,
"company_id": "31653758",
"company_mango_id": 0,
"company_name": "Crmango s.r.o.",
"company_country_id": 56,
"company_country": "CZ",
"company_address": "Hlavna 70",
"company_postal": "32323",
"person_name": "",
"person_surname": "",
"person_phone": "",
"person_email": "",
"person_mango_id": 0,
"lead_status_id": 1,
"lead_source_id": 3,
"lead_campaign_id": 1,
"priority": 1,
"lead_note": "Datum a cas: 01.12.2022 14:51",
"product_id": 11
}
]
}
{
"code": "int",
"message": "string"
}