UpdateContact

Function to update contact. Only the sent fields are changed, the rest stays. Custom columns (own_cols) can be sent partially. Active items (aktivnep_id) are changed only when sent.

PUT https://rest.crmango.com/api/UpdateContact

Authorization

1 Sent in the request headers
Bearer varchar

Auth token

Body data

40 Sent in the request body
contact_id integer

Contact id
Reference: GetAllContacts

owner integer

Company owner
Reference: GetAllUsers

is_company boolean

0 - self-employed, 1 - company

title varchar

Company name

company_id_number integer

Company id number (numbers only)

vat_number varchar

Company vat number

vat varchar

Company vat

firstname varchar

Firstname

lastname varchar

Lastname

birth_number varchar

Birth number

address varchar

Address

city varchar

City

postcode integer

Postcode

district varchar

District

region varchar

Region

state varchar

State id or ISO2 code (e.g. SK). Unknown code = 202
Reference: GetAllStates

latitude float

Latitude

longitude float

Longitude

disabled boolean

0 - active, 1 - disabled

user integer

User id (salesman)
Reference: GetAllUsers

next_activity timestamp

Date of next activity

status_id integer

Status id
Reference: GetAllLists

typk_id integer

Contact type id. User must have the right to see this type
Reference: GetAllLists

aktivnep_id varchar

Active items id, e.g. ,2,4,7,
Reference: GetAllLists

score integer

Score 0 - 5

invoice_days integer

Invoice due days

invoice_type integer

Invoice type

invoice_note varchar

Invoice note

credit_limit float

Credit limit

company_currency varchar

Currency id or code (e.g. EUR). Unknown code = 202

invoice_email varchar

E-mail for invoices

mailing_name varchar

Mailing address - name

mailing_address varchar

Mailing address - street

mailing_city varchar

Mailing address - city

mailing_postal integer

Mailing address - postcode

mailing_state varchar

Mailing address - state id or ISO2 code
Reference: GetAllStates

internal_note varchar

Internal note (stored encrypted)

general_discount float

General discount in percent

own_cols[id_own_col] integer

Own col input id
Reference: GetContactOwnCols

own_cols[data] varchar

Input data

Response

2 HTTP 200

Function to update contact

code integer

Return code

message varchar

Info message

Example request

curl --request PUT \
  --url 'https://rest.crmango.com/api/UpdateContact' \
  --header 'Authorization: Bearer auth_token' \
  --header 'Content-Type: application/json' \
  --data '{
    {
        "contact_id": 3482,
        "data": {
            "owner": 7,
            "is_company": 1,
            "title": "CRMango",
            "company_id_number": "123456",
            "vat_number": "SK123456",
            "vat": "123456",
            "firstname": "Anton",
            "lastname": "Mrkvicka",
            "birth_number": "",
            "address": "Dopravna",
            "city": "Bratislava",
            "postcode": "92101",
            "district": "Bratislava",
            "region": "Bratislavsky",
            "state": "202",
            "latitude": "",
            "longitude": "",
            "disabled": 0,
            "user": 57,
            "next_activity": 0,
            "status_id": 0,
            "typk_id": 0,
            "aktivnep_id": ",1,2,",
            "own_cols": [
                {
                    "id_own_col": 1,
                    "data": "This is text"
                },
                {
                    "id_own_col": 2,
                    "data": "2022-09-23"
                },
                {
                    "id_own_col": 3,
                    "data": "Apple"
                },
                {
                    "id_own_col": 5,
                    "data": "This is text"
                },
                {
                    "id_own_col": 7,
                    "data": 1
                }
            ]
        }
    }
  }'
{
    "code": 200,
    "message": "Contact has been updated"
}