UploadFileToTask

Upload file to task

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

Authorization

1 Sent in the request headers
Bearer varchar

Auth token (required in Authorization header)

Body data

4 Sent in the request body
filename varchar

Name of the file, including extension (e.g. document.pdf)

data varchar

Base64 encoded content of the file

user_id integer

User ID who is uploading the file
Reference: GetAllUsers

task_id integer

Task ID to which the file will be attached

Response

2 HTTP 201

Function to upload file to task

code integer

HTTP status code (201 = Created, 400/401/503 = Error)

message varchar

Status message with details

Example request

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
    }
  }'
{
    "code": 201,
    "message": "File was successfully uploaded"
}