Attach file

Description

Attach a file to a case.

Request

HTTP Method: POST

Parameter Description
filename The name of the file to be added to the case.
file_contents Base64 encoded file contents to attach to the case.
value Optional The value of the comment to be added to the case.
author_email Optional The email of the user attaching the file to the case.
Path Parameter Description
case_id ID of the case.

Sample request

curl -X POST \
  https://<<META.tenant.domain>>/api/v1/cases/<<case_id>>/attach_file \
  -H 'content-type: application/json' \
  -H 'x-user-token: <<CREDENTIAL.tines_api_key>>' \
  -d '{
        "filename": "Name of file",
        "file_contents": "QmFzZTY0IGVuY29kZWQgZlsZSBjb250ZW50cw==",
        "value": "This is a comment alongside a file attachment."
      }'

Response

A successful request will return a JSON object describing the action taken on the case - file_attached in this instance.

Field description

Parameter Description
id The ID of the record with the file attached to the case.
action The action taken on the case - file_attached or file_attached_and_commented in this instance.
value The comment added alongside file.
user Details of the user who attached the file - id, first & last name, email & avatar url.

Sample response

{
  "id": 7508,
  "action": "FILE_ATTACHED_AND_COMMENTED",
  "value": "This is a comment alongside a file",
  "user": {
    "id": 1,
    "first_name": "Jane",
    "last_name": "Doe",
    "email": "jane@tines.io"
  }
}
Was this helpful?