Upload file to task
https://rest.crmango.com/api/UploadFileToTask
Bearer
varchar
Auth token (required in Authorization header)
filename
varchar
Name of the file, including extension (e.g. document.pdf)
data
varchar
Base64 encoded content of the file
task_id
integer
Task ID to which the file will be attached
Function to upload file to task
code
integer
HTTP status code (201 = Created, 400/401/503 = Error)
message
varchar
Status message with details
curl --request POST \
--url 'https://rest.crmango.com/api/UploadFileToTask' \
--header 'Authorization: Bearer auth_token' \
--header 'Content-Type: application/json' \
--data '{
{
"filename": "example.pdf",
"data": "JVBERi0xLjQKJaqrrK0KNCAwIG9iago8PC9UeXBlIC9Y",
"user_id": 23,
"task_id": 120
}
}'
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://rest.crmango.com/api/UploadFileToTask',
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 => '{
{
"filename": "example.pdf",
"data": "JVBERi0xLjQKJaqrrK0KNCAwIG9iago8PC9UeXBlIC9Y",
"user_id": 23,
"task_id": 120
}
}',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer auth_token',
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
echo $response;
var data = JSON.stringify({
{
"filename": "example.pdf",
"data": "JVBERi0xLjQKJaqrrK0KNCAwIG9iago8PC9UeXBlIC9Y",
"user_id": 23,
"task_id": 120
}
});
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/UploadFileToTask");
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/UploadFileToTask"
payload = json.dumps({
{
"filename": "example.pdf",
"data": "JVBERi0xLjQKJaqrrK0KNCAwIG9iago8PC9UeXBlIC9Y",
"user_id": 23,
"task_id": 120
}
})
headers = {
'Authorization': 'Bearer auth_token',
'Content-Type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
{
"code": 201,
"message": "File was successfully uploaded"
}
{
"code": "int",
"message": "string"
}