dolibarr  7.0.0-beta
or

Return a document.

Parameters
int$idID of document
Returns
array Array with data of file
Exceptions
RestExceptionUpload a file.

Test sample 1: { "filename": "mynewfile.txt", "modulepart": "facture", "ref": "FA1701-001", "subdir": "", "filecontent": "content text", "fileencoding": "", "overwriteifexists": "0" }. Test sample 2: { "filename": "mynewfile.txt", "modulepart": "medias", "ref": "", "subdir": "image/mywebsite", "filecontent": "Y29udGVudCB0ZXh0Cg==", "fileencoding": "base64", "overwriteifexists": "0" }.

Parameters
string$filenameName of file to create ('FA1705-0123.txt')
string$modulepartName of module or area concerned by file upload ('facture', 'project', 'project_task', ...)
string$refReference of object (This will define subdir automatically and store submited file into it)
string$subdirSubdirectory (Only if ref not provided)
string$filecontentFile content (string with file content. An empty file will be created if this parameter is not provided)
string$fileencodingFile encoding (''=no encoding, 'base64'=Base 64) { 'base64'}
int$overwriteifexistsOverwrite file if exists (1 by default)
Exceptions
200
400
401
404
500POST /upload