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 describing the document object. You can retrieve a sample JSON 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
- Parent Id is mandatory and must be the ID of a folder. Without it, the document is created but does not appear in the user interface.
- Files is an array, but you must specify exactly one file.
- You must pass the file size in bytes explicitly.
Response¶
HTTP status code 200
Body¶
The response body contains the ID of the created document.
Media type: application/json
Example:
{
"Value": "841054dd-ce63-4e93-b176-0753ff2ec1eb"
}