CreateNewPerson

Function to create a new person

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

Authorization

1 Sent in the request headers
Bearer varchar

Auth token

Body data

16 Sent in the request body
owner integer

User id
Reference: GetAllUsers

firstname varchar

Firstname

lastname varchar

Lastname

title_before_name varchar

Title before name

title_after_name varchar

Title after name

work_position varchar

Work position

phone1_prefix varchar

Phone 1 prefix
Reference: GetAllStates

phone_1 integer

Phone 1

phone2_prefix varchar

Phone 2 prefix
Reference: GetAllStates

phone_2 integer

Phone 2

email varchar

E-mail

company_id integer

User id
Reference: GetAllContacts

birth_number varchar

Birth number

allow_send_email boolean

True or False: You need the client consent to send them marketing emails.

own_cols[id_own_col] integer

Own col input id id
Reference: GetPersonOwnCols

own_cols[data] varchar

Input data

Response

3 HTTP 201

Function to create a new person

code integer

Return code

message varchar

Info message

created_id integer

Id of the created resource

Example request

curl --request POST \
  --url 'https://rest.crmango.com/api/CreateNewPerson' \
  --header 'Authorization: Bearer auth_token' \
  --header 'Content-Type: application/json' \
  --data '{
    "data": {
      "owner": 7,
      "firstname": "Anton",
      "lastname": "Mrkvicka",
      "title_before_name": "Ing",
      "title_after_name": "",
      "work_position": "CEO",
      "phone1_prefix": "SK +421",
      "phone_1": "911123456",
      "phone2_prefix": "CZ +420",
      "phone_2": "703456789",
      "email": "support@crmango.com",
      "company_id": 3468,
      "birth_number": "123456/3654",
      "allow_send_email": true,
      "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": 201,
    "message": "New person has been added",
    "created_id": 2654
}