POST /ws/rest/service/v1/dm/document/create
Purpose
- Provide the ability for customers to add documents (files) with their metadata to particular folder.
- Supports adding revision to an existing document.
Input
This a multipart request and All parameters should be BEFORE all file parts and should follow the below order.
- projectnumber (String) Optional. Not required for company level.
- dorevise: (String) Optional .This flag is used to automatically revise file with same file name. Expected values are "yes" or "no". Default is no.
- data (JSON String) Required: List of field and values for the document attribute form.
- Path: Full path where the document will be created. The folder path must exists for the document to be created.
- Name: Name of the document that needs to be created.
Example:
To create a document "ProjectDetails.doc" under "/Project Documents/Service docs" then data should as below
[
{"path":"/Service docs","fileName":"ProjectDetails.doc","docTitle":"project details","revNo":"1","issueDate":"06/01/2016", additional document attribute form properties, excluding creation date and owner }
]
Example Multipart Form Request:
Note: The form data body boundary in the example below is "—file upload—", but can be anything (or left unset).
-----file upload---
Content-Disposition: form-data; name="shortname"
unifier
-----file upload---
Content-Disposition: form-data; name="authcode"
MTIzMTIz
-----file upload---
Content-Disposition: form-data; name="dorevise"
yes
-----file upload---
Content-Disposition: form-data; name="projectnumber"
Shell-001
-----file upload---
Content-Disposition: form-data; name="data"
[
{"Path":"/Service docs","Name":"ProjectDetails.doc","docTitle":"project details","revNo":"1","issueDate":"06/01/2016", additional document attribute form properties, excluding creation date and owner }
]
-----file upload---
Content-Disposition: form-data; name="0"; filename="b.txt" Content-Type: text/plain
test document contents
-----file upload-----
Output
Json object containing 'status', 'data', 'message'