Set file properties
A request to set file properties.
Заметка
[Since 2017.01] It’s allowed to set custom properties which id/key is started with custom_ prefix
POST /api/v1/files/{fileId}/properties HTTP/1.1
Generates Notification metadata changed.
- Path parameters
| Parameter | Description |
|---|---|
fileId | The ID of the file. |
- Request structure
| Path | Type | Description |
|---|---|---|
[].id | String | The ID of the property. |
[].key | String | The key of this property. |
[].value | String | The value of this property. Use value="undef" for removing custom property |
- Response structure
| Path | Type | Description |
|---|---|---|
[] | Array | Array of property objects. |
[].links | Array | Array of links to file object. See File Links |
[].property.id | String | The file’s property id. |
[].property.key | String | The file’s property key. |
[].property.value | String | The file’s property value. |
[].links[].rel | String | Link type |
[].links[].href | String | Link reference |
- Example request
curl 'http://localhost:8080/api/v1/files/189360784/properties' -i -X POST \
-H 'Content-Type: application/json' \
-H 'X-co-auth-token: b35642d88a3d3c2f896721f3b6999456' \
-d '[
{
"id": "flagged",
"key": "flagged",
"value": "true"
},
{
"id": "custom_my_1",
"key": "custom_my_1",
"value": "my custom value"
}
] '
- Example response
HTTP/1.1 200 OK
X-co-request-id: 74556b657155367a4166764731416a66
Content-Type: application/vnd.ncloudtech.cloudoffice.propertylist+json;v=1;charset=UTF-8
Content-Length: 411
[
{
"property": {
"id": "flagged",
"key": "flagged",
"value": "true"
},
"links": [
{
"rel": "self",
"href": "http://localhost:8080/api/v1/files/flagged"
}
]
},
{
"property": {
"id": "custom_my_1",
"key": "custom_my_1",
"value": "my custom value"
},
"links": [
{
"rel": "self",
"href": "http://localhost:8080/api/v1/files/custom_my_1"
}
]
}
]