CreateNewActivity

Function to create a new activity

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

Authorization

1 Sent in the request headers
Bearer varchar

Auth token

Body data

21 Sent in the request body
note varchar

Activity note

timefrom timestamp

Time from

timeto timestamp

Time to

type_id integer

Activity type
Reference: GetOwnActivity, GetOwnActivitiesParams

userid integer

User
Reference: GetAllUsers

company_id integer

Company id
Reference: GetAllContacts

orderid integer

Order id

person_id integer

Person id
Reference: GetAllPersons

readonly_record boolean

Readonly record?

verified_record integer

Verified

to_report boolean

Insert record to report

my_company boolean

My company?

order_code varchar

Order code

software_id integer

Software id

source_direction varchar

Source direction IN/OUT

company_name varchar

Company name
Reference: GetAllContacts

unassigned varchar

Unassigned

next_activity timestamp

Date of next activity

own_cols[id_input] integer

Own cols input id
Reference: GetOwnActivity, GetOwnActivitiesParams

own_cols[data_type] varchar

Own cols input data type
Reference: GetOwnActivity, GetOwnActivitiesParams

own_cols[data] varchar

Input data

Response

3 HTTP 200

Function to create a new activity

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/CreateNewActivity' \
  --header 'Authorization: Bearer auth_token' \
  --header 'Content-Type: application/json' \
  --data '{
    "data": {
      "note": "This is my note",
      "timefrom": 1658820864,
      "timeto": 1658821864,
      "type_id": 129,
      "userid": 7,
      "company_id": 3468,
      "orderid": 0,
      "person_id": 0,
      "readonly_record": 0,
      "verified_record": 1,
      "to_report": 1,
      "my_company": 0,
      "order_code": "",
      "software_id": 0,
      "source_direction": "",
      "company_name": "CRMango",
      "unassigned": "",
      "next_activity": 1688822306,
      "own_cols": [
        {
          "id_input": 1,
          "data_type": "nadpis",
          "data": ""
        },
        {
          "id_input": 2,
          "data_type": "hr",
          "data": ""
        },
        {
          "id_input": 3,
          "data_type": "text",
          "data": "This is example text"
        },
        {
          "id_input": 4,
          "data_type": "textarea",
          "data": "Long text example"
        },
        {
          "id_input": 5,
          "data_type": "number",
          "data": "32323"
        },
        {
          "id_input": 6,
          "data_type": "date",
          "data": "1658822421"
        },
        {
          "id_input": 7,
          "data_type": "time",
          "data": "08:24:00"
        },
        {
          "id_input": 8,
          "data_type": "datetime-local",
          "data": "2022-07-01 23:59:23"
        },
        {
          "id_input": 9,
          "data_type": "listbox",
          "data": "Second"
        },
        {
          "id_input": 10,
          "data_type": "multiselect",
          "data": "First;Third;Fifth"
        },
        {
          "id_input": 11,
          "data_type": "checkbox",
          "data": "1"
        },
        {
          "id_input": 12,
          "data_type": "color",
          "data": "#4287f5"
        },
        {
          "id_input": 13,
          "data_type": "signature",
          "data": "https://rest.crmango.com/images/logo_header.svg"
        },
        {
          "id_input": 14,
          "data_type": "company",
          "data": "3468;CRMango"
        },
        {
          "id_input": 15,
          "data_type": "person",
          "data": "53;Janko Mrkvička"
        },
        {
          "id_input": 16,
          "data_type": "file",
          "data": "https://rest.crmango.com/images/logo_header.svg"
        }
      ]
    }
  }'
{
    "code": 201,
    "message": "New activity has been added",
    "created_id": 2351
}