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.
- Request parameters
| Parameter | Description |
|---|---|
fileId | The ID of the file. |
- Response structure
| Path | Type | Description |
|---|---|---|
[].parent.id | String | Parent folder id. |
[].parent.filename | String | Parent folder filename. |
[].links | Array | Link to the corresponding file object. See Get file info |
[].links[].rel | String | Link type |
[].links[].href | String | Link reference |
- Example request
curl 'http://localhost:8080/api/v1/files/189367628/parents' -i -X GET \
-H 'X-co-auth-token: ce7a7e4be4bc7b4e6a2e43b53520a612'
- 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"
}
]
}
]