Skip to main content

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
  1. Path parameters
ParameterDescription
docIdFile ID in storage to be used as template for new file. [Since 2019.01]
  1. Request fields
PathTypeDescription
filenameStringThe suggested name of the file.
parentIdStringThe parent folder (parentReferenceId) which contains this file. The root has no parent
mediaTypeForLoggingStringThe media type of the new file or template ( application/vnd.collabio.xodocuments.document )
  1. Response structure
PathTypeDescription
idStringThe ID of the file in storage.
filenameStringThe name of the real file.
parentIdStringThe parent folder (parentReferenceId) which contains this file. The root has no parent
mediaTypeForLoggingStringThe media type of the created file ( application/vnd.collabio.xodocuments.document )
  1. 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"
}'
  1. 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"
}