GetAllContacts

Function returns all contacts

POST https://rest.crmango.com/api/GetAllContacts

Authorization

1 Sent in the request headers
Bearer varchar

Auth token

Body data

16 Sent in the request body
date_from timestamp

Date from

date_to timestamp

Date to

date_type varchar

Date type to filter data by.
Options: created_at or updated_at

page integer

Pagination of results (default is 0)

limit integer

Limit of results per page (Max si 10000)

contact_id integer

Find company by id

search varchar

Full text search (max 100 characters): company name, company id number, VAT number, VAT, firstname, lastname or city. More words = all must match. Best matches first

sort_by varchar

Sort by.
Options: id, created_at, updated_at, title, last_activity, next_activity

sort_dir varchar

Sort direction.
Options: asc (default) or desc

user integer

Filter: salesman (user) id, 0 = unassigned
Reference: GetAllUsers

company_type integer

Filter: contact type id
Reference: GetAllLists

company_status integer

Filter: contact status id
Reference: GetAllLists

city varchar

Filter: city contains this text

state varchar

Filter: state id or ISO2 code (e.g. SK)
Reference: GetAllStates

is_company boolean

Filter: 1 - companies only, 0 - self-employed only

disabled boolean

Filter: 1 - disabled only, 0 - active only. Without it disabled contacts are returned too

Response

28 HTTP 200

Function returns all contacts

id integer

Record ID

created_at integer

Created date

updated_at varchar

Updated at date

is_company boolean

0 - self-employed, 1 - company

title varchar

Company name

company_id_number integer

Company id number

vat_number varchar

VAT number

vat varchar

VAT

firstname varchar

Person firstname

lastname varchar

Person lastname

birth_number varchar

Birth number

address varchar

Address

city varchar

City

postcode integer

Postcode

district varchar

District

region varchar

Region

state integer

State id

latitude float

Latitude

longitude float

Longitude

disabled boolean

0 - active, 1 - disabled

user integer

User id

last_activity integer

Date of last activity

next_activity integer

Date of next activity

company_status integer

Company status

company_type integer

Company type

company_active_services varchar

Active services in the company

vls_cols json

All custom columns data

hidden_by_rights integer

Only when called on behalf of a user: number of records hidden because the user has no right to see them

Example request

curl --request POST \
  --url 'https://rest.crmango.com/api/GetAllContacts' \
  --header 'Authorization: Bearer auth_token' \
  --header 'Content-Type: application/json' \
  --data '{
    "date_from": "timestamp",
    "date_to": "timestamp",
    "date_type": "varchar",
    "page": "integer",
    "limit": "integer",
    "contact_id": "integer",
    "search": "varchar",
    "sort_by": "varchar",
    "sort_dir": "varchar",
    "user": "integer",
    "company_type": "integer",
    "company_status": "integer",
    "city": "varchar",
    "state": "varchar",
    "is_company": "boolean",
    "disabled": "boolean"
  }'
{
    "code": 200,
    "response": [
        {
            "id": 3469,
            "created_at": 1648840028,
            "updated_at": "2024-03-10 22:14:15",
            "is_company": 1,
            "title": "CRMango",
            "company_id_number": "41414141",
            "vat_number": "41414141",
            "vat": "141411",
            "firstname": "Anton",
            "lastname": "Mrkvicka",
            "birth_number": "",
            "address": "Dopravna",
            "city": "Bratislava",
            "postcode": "92101",
            "district": "Bratislava",
            "region": "Bratislavsky",
            "state": "202",
            "latitude": "",
            "longitude": "",
            "disabled": 0,
            "user": 57,
            "last_activity": 0,
            "next_activity": 0,
            "company_status": 0,
            "company_type": 2,
            "company_active_services": ",8,16,17,",
            "vls_cols": [
                {
                    "data": "1,2",
                    "id_own_col": 1
                },
                {
                    "data": "Test Note",
                    "id_own_col": 2
                }
            ]
        }
    ]
}