Documents

Uploading Documents

📘

This action is an exception to the general rule that submitted data should be JSON-encoded; multipart/form-data supports a binary encoding, and is therefore more efficient on both network and CPU than submitting the attached_file as e.g. a Base64 encoded string in JSON.

To create a new document, do a multipart/form-data POST with parameters:

Parameter

Description

document[file_name]

name of the file, to be used in download links

document[description]

description of the file

document[attached_file]

file data (as from a file upload control in an HTML form)

An example, assuming you have a file ‘requirements.xls’ to upload:

% curl https://app.liquidplanner.com/api/v1/workspaces/:id/tasks/:id/documents \
       -F 'document[attached_file][email protected]'                      \
       -F 'document[file_name]=requirements.xls'

Downloading Documents

To download an existing document, do a GET with ‘download’ or ‘thumbnail’ appended, like:

% curl https://app.liquidplanner.com/api/v1/workspaces/:id/tasks/:id/documents/:id/download
% curl https://app.liquidplanner.com/api/v1/workspaces/:id/tasks/:id/documents/:id/thumbnail

You can also attach links to Box, DropBox, and Google Drive documents using a json POST with a document parameter:

It contains the following options:

Option

Description

type

one of "box", "dropbox", or "google drive"

browse_url

the url given by Box, Dropbox, or Google Drive as the shareable url for the document

file_name

name of the file, to be used in download links

description

description of the file (optional)

icon_url

link to the image preview which is supplied by Dropbox (applies only to, and is required by, Dropbox attachments)

For example:

% curl https://app.liquidplanner.com/api/v1/workspaces/:id/tasks/:id/documents \
       -d '{ "document": { "browse_url": "https://box.com/link/to/file", "file_name": "FileName.doc", "description": "A description", "type" : "box"  } }'