Function to create a new activity
https://rest.crmango.com/api/CreateNewActivity
Bearer
varchar
Auth token
note
varchar
Activity note
timefrom
timestamp
Time from
timeto
timestamp
Time to
orderid
integer
Order id
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
unassigned
varchar
Unassigned
next_activity
timestamp
Date of next activity
own_cols[data_type]
varchar
Own cols input data type
Reference: GetOwnActivity, GetOwnActivitiesParams
own_cols[data]
varchar
Input data
Function to create a new activity
code
integer
Return code
message
varchar
Info message
created_id
integer
Id of the created resource
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"
}
]
}
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://rest.crmango.com/api/CreateNewActivity',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => '{
"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"
}
]
}
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer auth_token',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
echo $response;
var data = JSON.stringify({
"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"
}
]
}
});
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function () {
if (this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("POST", "https://rest.crmango.com/api/CreateNewActivity");
xhr.setRequestHeader("Authorization", "Bearer auth_token");
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(data);
import requests
import json
url = "https://rest.crmango.com/api/CreateNewActivity"
payload = json.dumps({
"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"
}
]
}
})
headers = {
'Authorization': 'Bearer auth_token',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
{
"code": 201,
"message": "New activity has been added",
"created_id": 2351
}
{
"code": "int",
"message": "string"
}