Create new empty document from default template
Заметка
[Since 2019.01]
A request to create new empty document for future opening it.
POST /api/v1/documents HTTP/1.1
- 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 ). |
lang | String | The language of the template file (en-US ru-RU) |
- 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 ). |
lang | String | The language of the template file (en-US ru-RU). |
- Example request
curl 'http://localhost:9094/api/v1/documents' -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",
"lang":"en-US"
}'
- 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",
"lang" : "en-US"
}