POST api/2.0/files/@my/file
Creates a new file in the "My documents" section with the title specified in the request.
Name |
Description |
Type |
Example |
title
sent in body
|
File title
Allowed values: the file must have one of the following extensions: DOCX, XLSX, PPTX
|
string
|
some text
|
In case an extension for the file title differs from DOCX/XLSX/PPTX and belongs to one of the known text, spreadsheet or presentation formats, it will be changed to DOCX/XLSX/PPTX accordingly. If the file extension is not set or is unknown, the DOCX extension will be added to the file title.
POST api/2.0/files/@my/file
Host: yourportal.onlyoffice.com
Content-Type: application/json
Accept: application/json
{
"title": "some text"
}
application/json
{
"status": 0,
"response": {
"folderId": 12334,
"version": 3,
"versionGroup": 1,
"contentLength": "12.06 KB",
"pureContentLength": 12345,
"fileStatus": 2,
"viewUrl": "http:\/\/www.onlyoffice.com\/viewfile?fileid=2221",
"fileType": 7,
"fileExst": ".txt",
"comment": null,
"id": 207260230,
"title": "Some titile.txt",
"access": 1,
"shared": false,
"rootFolderType": 2,
"updatedBy": {
"id": "00000000-0000-0000-0000-000000000000",
"displayName": "Mike Zanyatski",
"title": "Manager",
"avatarSmall": "url to small avatar",
"profileUrl": ""
},
"created": "2023-01-27T05:35:44.7647856Z",
"createdBy": {
"id": "00000000-0000-0000-0000-000000000000",
"displayName": "Mike Zanyatski",
"title": "Manager",
"avatarSmall": "url to small avatar",
"profileUrl": ""
},
"updated": "2023-01-27T05:35:44.7647856Z"
}
}
text/xml
<result>
<status>0</status>
<response>
<folderId>12334</folderId>
<version>3</version>
<versionGroup>1</versionGroup>
<contentLength>12.06 KB</contentLength>
<pureContentLength>12345</pureContentLength>
<fileStatus>2</fileStatus>
<viewUrl>http://www.onlyoffice.com/viewfile?fileid=2221</viewUrl>
<fileType>7</fileType>
<fileExst>.txt</fileExst>
<comment />
<id>207260230</id>
<title>Some titile.txt</title>
<access>1</access>
<shared>false</shared>
<rootFolderType>2</rootFolderType>
<updatedBy>
<id>00000000-0000-0000-0000-000000000000</id>
<displayName>Mike Zanyatski</displayName>
<title>Manager</title>
<avatarSmall>url to small avatar</avatarSmall>
<profileUrl></profileUrl>
</updatedBy>
<created>2023-01-27T05:35:44.7647856Z</created>
<createdBy>
<id>00000000-0000-0000-0000-000000000000</id>
<displayName>Mike Zanyatski</displayName>
<title>Manager</title>
<avatarSmall>url to small avatar</avatarSmall>
<profileUrl></profileUrl>
</createdBy>
<updated>2023-01-27T05:35:44.7647856Z</updated>
</response>
</result>