Get file json metadata
This method returns the json metadata associated with file specified by $FILE_ID.
By default the method returns the complete json metadata. But it is possible to request
only a part of the document by specifying filter_type and filter attributes in the query.
Supported filter types are:
- keypath - list of JSON keys which point to requested JSON object,
separated by
., array elements should be expressed as[i](e.g.key1.key2.[2].key3)
Example cURL requests
Get specific JSON value from metadata document
curl -H "X-Auth-Token: $TOKEN" -X GET \
https://$HOST/api/v3/oneprovider/data/$FILE_ID/metadata/json?filter_type=keypath&filter=key1.key2.[2].key3
{"key4": "value"}
Path parameters
| Parameter | Type & Description |
|---|---|
| id required | string Id of the file. |
Query parameters
| Parameter | Type & Description |
|---|---|
| filter_type | string The type of filter to apply to the metadata document. |
| filter | string The filter to apply to the metadata document before returning. Required if |
| inherited | boolean When set to true, this operation will merge the metadata documents from parent directories as well as entire space into a single JSON document. |
Request Examples
oneprovider-rest-cli getJsonMetadata id=$FILE_ID inherited=falseResponses
JSON metadata returned successfully.
No schema provided.
Invalid request.
| Property | Type & Description |
|---|---|
error string Identifier representing internal error code. | |
error_description string Detailed error message. | |
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}Forbidden request.
| Property | Type & Description |
|---|---|
error string Identifier representing internal error code. | |
error_description string Detailed error message. | |
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}File not found.
| Property | Type & Description |
|---|---|
error string Identifier representing internal error code. | |
error_description string Detailed error message. | |
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}Internal server error.
| Property | Type & Description |
|---|---|
error string Identifier representing internal error code. | |
error_description string Detailed error message. | |
Example
{
"error": "invalid_token",
"error_description": "Provided token could not be validated."
}