Create new document from user’s template
Заметка
[Since 2019.01]
A request to create new document from template document for future opening it
POST /api/v1/documents/{docId} HTTP/1.1
- Path parameters
| Parameter | Description |
|---|---|
docId | File ID in storage to be used as template for new file. [Since 2019.01] |
- Request fields
| Path | Type | Description |
|---|---|---|
filename | String | The suggested name of the file. |
parentId | String | The parent folder (parentReferenceId) which contains this file. The root has no parent |
mediaTypeForLogging | String | The media type of the new file or template ( application/vnd.collabio.xodocuments.document ) |
- Response structure
| Path | Type | Description |
|---|---|---|
id | String | The ID of the file in storage. |
filename | String | The name of the real file. |
parentId | String | The parent folder (parentReferenceId) which contains this file. The root has no parent |
mediaTypeForLogging | String | The media type of the created file ( application/vnd.collabio.xodocuments.document ) |
- Example request
curl -XPOST 'http://localhost:9094/api/v1/documents/O3231hpR9pL5WEirt2X1' -H 'X-co-auth-token: 8705adfeb88111b472e089a6af6aa929' -H 'Content-Type: application/json;charset=UTF-8' -d '{
"filename":"mydoc.xodt",
"parentId":"O3231hpR9pL5WEirt2X",
"mediaTypeForLogging":"application/vnd.collabio.xodocuments.document"
}'
- Example response
HTTP/1.1 200 OK
Content-Length: 162
Content-Type: application/json;charset=UTF-8
{
"id": "O3232hw1p0Bx2gY2bFZ",
"parentId": "O3231hpR9pL5WEirt2X",
"filename": "mydoc (2).xodt",
"mediaTypeForLogging": "application/vnd.collabio.xodocuments.document"
}