Skip to main content

Get file parents

A request to get file’s parents

POST /api/v1/files/{fileId}/parents HTTP/1.1

Returns parents list, ordered from the nearest parent to the top one.

  1. Request parameters
ParameterDescription
fileIdThe ID of the file.
  1. Response structure
PathTypeDescription
[].parent.idStringParent folder id.
[].parent.filenameStringParent folder filename.
[].linksArrayLink to the corresponding file object. See Get file info
[].links[].relStringLink type
[].links[].hrefStringLink reference
  1. Example request
curl 'http://localhost:8080/api/v1/files/189367628/parents' -i -X GET \
-H 'X-co-auth-token: ce7a7e4be4bc7b4e6a2e43b53520a612'
  1. Example response
HTTP/1.1 200 OK
X-co-request-id: 633876537636384d7649687054666648
Content-Type: application/vnd.ncloudtech.cloudoffice.parentlist+json;v=1;charset=UTF-8
Content-Length: 1219
[
{
"parent": {
"id": "189367563",
"filename": "New Folder"
},
"links": [
{
"rel": "file",
"href": "http://localhost:8080/api/v1/files/189367563"
}
]
},
{
"parent": {
"id": "189367508",
"filename": "New Folder"
},
"links": [
{
"rel": "file",
"href": "http://localhost:8080/api/v1/files/189367508"
}
]
},
{
"parent": {
"id": "189367453",
"filename": "docs-test-getFileParentsExample()-2dtPH27npJ"
},
"links": [
{
"rel": "file",
"href": "http://localhost:8080/api/v1/files/189367453"
}
]
},
{
"parent": {
"id": "88458287",
"filename": ".root"
},
"links": [
{
"rel": "file",
"href": "http://localhost:8080/api/v1/files/88458287"
}
]
}
]