Skip to main content

Create new empty document from default template

note

[Since 2019.01]

A request to create new empty document for future opening it.

POST /api/v1/documents HTTP/1.1
  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 ).
langStringThe language of the template file (en-US ru-RU)
  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 ).
langStringThe language of the template file (en-US ru-RU).
  1. 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"
}'
  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",
"lang" : "en-US"
}