Skip to main content

Move file

POST /api/v1/files/{fileId}/move/{folderId} HTTP/1.1

Generates notifications:

  • Notification file move for file owner.
  • Notification file delete for share user, if the file was moved from the shared folder [not sent at 2017.04].
  • Notification add file/folder for share user, if the file was moved to the shared folder.
  • Notification file unshare for share user, if the operation overwrites the file, shared to someone.
  • Notification file’s permissions changed for file owner if the object has parent share.
  1. Path parameters
ParameterDescription
fileIdThe ID of the source file.
folderIdThe ID of the target folder.
  1. Request parameters
ParameterDescription
conflictStrategyConflict resolution strategy (keep_both / overwrite / versioned)
  1. Response structure

See Get File Info Response structure.

  1. Example request
curl 'http://localhost:8080/api/v1/files/189339962/move/189340073?conflictStrategy=keep_both' -i -X POST \
-H 'X-co-auth-token: 354787c9a9f8e8bee22ebd69b7cf2698' \
-H 'Content-Type: application/x-www-form-urlencoded'
  1. Example response
HTTP/1.1 200 OK
X-co-request-id: 6e6d7a56347273725947707172485167
Content-Type: application/vnd.ncloudtech.cloudoffice.file+json;v=1;charset=UTF-8
Content-Length: 2193
{
"file": {
"id": "189339962",
"createdDate": "2022-04-06T15:56:00.000Z",
"creator": "testsrvdocs@tacos.devoffice.ru",
"creatorFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"creatorFirstName": "r",
"creatorLastName": "t",
"creatorMiddleName": "f",
"fileSize": "20",
"filename": "testfile.txt",
"headRevisionId": "189339963",
"lastModifyingUserId": "testsrvdocs@tacos.devoffice.ru",
"lastModifyingUserFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"lastModifyingUserFirstName": "r",
"lastModifyingUserLastName": "t",
"lastModifyingUserMiddleName": "f",
"mediaType": "text/plain",
"modifiedByMeDate": "2022-04-06T15:56:00.000Z",
"modifiedDate": "2022-04-06T15:56:00.000Z",
"ownerFsId": "5177189d266a4862ad93b1cda2f5ac2b",
"ownerId": "testsrvdocs@tacos.devoffice.ru",
"parentId": "189340073",
"properties": [],
"totalSize": "20",
"checksum": "e0e102b9ff40785fac8902d8bcbf2279",
"tree": "/docs-test-moveFileExample()-AIvd2JXgTH/New Folder/testfile.txt",
"ownerFirstName": "r",
"ownerLastName": "t",
"ownerMiddleName": "f",
"isVersion": false,
"originalFileIdOpt": null,
"creatorIsDeleted": false,
"editorIsDeleted": false,
"ownerIsDeleted": false,
"ownerAvatar": "a00bbb30-993e-4632-925f-152939195049",
"creatorAvatar": "a00bbb30-993e-4632-925f-152939195049",
"editorAvatar": "a00bbb30-993e-4632-925f-152939195049"
},
"links": [
{
"rel": "self",
"href": "http://localhost:8080/api/v1/files/189339962"
},
{
"rel": "download",
"href": "http://localhost:8080/api/v1/files/189339962/content"
},
{
"rel": "import",
"href": "http://localhost:8080/api/v1/files/189339962/import"
},
{
"rel": "preview",
"href": "http://localhost:8080/api/v1/files/189339962/preview"
},
{
"rel": "link",
"href": "http://localhost:8080/link/189339962"
}
]
}