POST
The POST method lets you:
Add a new Document (=File) Item to the specified parent
Add a new version or Replace an existing document
A successful create returns response code 200 and the newly created document(s) in JSON format (see Item API).
POST projecten.viadesk.com/api/document.json
Add new document
form field “parent” // required. The parent in which the document(s) will be created. Parent must be a folder or an office (required)
form field “text” //represents the document notes. These notes will be added to all uploaded files
You can add one or more files by posting multipart/form-data. They will all be added to the specified parent. The user calling the API must have add children rights on the parent.
Add new version
form field “id” // required. The pointer of the document
form field “text” //represents the document notes. These notes will be added to all uploaded files
form field “isNewVersion” //boolean
- You can add one file by posting multipart/form-data. If the newVersion option is true, the user needs add children rights on the document. If newVersion is false or absent (so document is replaced), the user needs edit rights.
- Also, keep in mind that the file extension of the new upload must be the same as the file extension of the existing document. If the existing document is locked the user must have the rights to unlock the document.