GetAllLeads

Function returns leads. Without parameters all leads are returned; the result can be filtered, searched, sorted and paged

GET https://rest.crmango.com/api/GetAllLeads

Authorization

1 Sent in the request headers
Bearer varchar

Auth token

Body data

19 Sent in the request body
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

lead_status_id integer

Only leads with this status
Reference: GetAllLists

lead_source_id integer

Only leads with this source
Reference: GetAllLists

lead_campaign_id integer

Only leads from this campaign
Reference: GetAllLists

priority integer

Only leads with this priority
Options: 1, 2 or 3

lead_creator integer

Only leads created by this user
Reference: GetAllUsers

lead_assignee integer

Only leads of this assignee, 0 = unassigned
Reference: GetAllUsers

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

Response

26 HTTP 200

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

Example request

curl --request GET \
  --url 'https://rest.crmango.com/api/GetAllLeads' \
  --header 'Authorization: Bearer auth_token'
{
    "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
        }
    ]
}