Create document¶
Endpoint - /documents/upload
HTTP Method – POST
Request¶
Headers¶
Parameter | Description |
---|---|
clientname | (mandatory) Portfolio name |
authorization | (mandatory) Authentication token |
projectId | (mandatory) Project identifier |
Body¶
Type – form-data
Keys¶
Name: A, Type: Text, Value:JSON ,described the document object. The sample of the JSON can be retrieved using the Get/Find Documents method
Name:B, Type: File, Value – document file
Example of the Document JSON¶
{
"Name": "2012-03-23-Duplex-Programming.xlsx",
"Parent": {
"Id": "723d3996-6b6d-4429-93bc-0d9bb4472e31"
},
"Files": [
{
"Size": 158064,
"Name": "2012-03-23-Duplex-Programming.xlsx",
"ContentType": "application/octet-stream"
}
]
}
Note
- Id is a mandatory field where ID is the ID of a folder. Without Parent Id you will be able create a new document, but you will not find in the in use interface.
- Files is an array, but you always must specify only one file
- Need to pass the file size in bytes explicitly (will be solved in the future)
Response¶
HTTP status code 200
Body¶
In the Response result there is Id of the created document
Media type: application/json
Example:
{
"Value": "841054dd-ce63-4e93-b176-0753ff2ec1eb"
}