Get shared file or directory data
This endpoint can be used to fetch publicly available information and content of a shared file or directory knowing its Id, without any authentication. It redirects to the corresponding REST endpoint in one of the supporting Oneproviders. The Oneprovider is chosen dynamically and may change in time, so the redirection URL should not be cached.
The endpoint accepts only identifiers of shared files/directories and will reject requests if a containing share is deleted. The shared file/directory Id can be acquired either by fetching public share details or by listing a shared directory.
The provided query string (if any) is preserved during redirection - consult corresponding Oneprovider REST endpoints for possible options.
Currently, publicly available operations are:
{...}/$FILE_ID/content- download file or directory content (see Oneprovider REST endpoint){...}/$FILE_ID/children- list directory files and subdirectories (see Oneprovider REST endpoint){...}/$FILE_ID- get basic attributes of a file or directory (see Oneprovider REST endpoint){...}/$FILE_ID/metadata/xattrs- get custom extended attributes (xattrs) associated with a file or directory (see Oneprovider REST endpoint){...}/$FILE_ID/metadata/json- get custom JSON metadata associated with a file or directory (see Oneprovider REST endpoint){...}/$FILE_ID/metadata/rdf- get custom RDF metadata associated with a file or directory (see Oneprovider REST endpoint)
The endpoint will return 503 Service Unavailable when there is no suitable
Oneprovider to handle the request and 501 Not Implemented when all available
Oneproviders are in versions older than 20.02.*. If an invalid subpath
is requested, the target Oneprovider will respond with a proper error.
Example cURL requests
Get shared file or directory data
curl -v -X GET https://$ZONE_HOST/api/v3/onezone/shares/data/$FILE_ID/content
< HTTP/1.1 307 Temporary Redirect
< location: https://provider.example.com/api/v3/oneprovider/data/$FILE_ID/content
# -------------------------------------------------------------------------------
curl -v -X GET https://$ZONE_HOST/api/v3/onezone/shares/data/$FILE_ID/children?limit=3
< HTTP/1.1 307 Temporary Redirect
< location: https://provider.example.com/api/v3/oneprovider/data/$FILE_ID/children?limit=3
# -------------------------------------------------------------------------------
# automatically follow redirects with -L option, request a byte range
curl -L -X GET https://$ZONE_HOST/api/v3/onezone/shares/data/$FILE_ID/content \
-H "Range: bytes=5-8"
fghi
Path parameters
| Parameter | Type & Description |
|---|---|
| file_id required | string Shared file/directory Id. |
| subpath required | string Subpath corresponding to desired Oneprovider REST API operation. |
Request Examples
onezone-rest-cli getSharedData file_id=000000000055D4E4836803640004677569646D00 subpath='content'Responses
Redirection to one of the supporting providers in the response Location header.
Invalid request.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authentication error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Authorization error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Resource not found.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Internal server Error.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Not Implemented - all available providers are in versions older than 20.02.*.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}Service Unavailable - there is no suitable provider to handle the request.
| Property | Type & Description | ||||||
|---|---|---|---|---|---|---|---|
error object Object describing an error.
| |||||||
Example
{
"error": {
"id": "badValueString",
"details": {
"key": "name"
},
"description": "Bad value: provided \"name\" must be a string."
}
}