Create share
Shares a file or a directory. Shared files can be viewed by everyone through public URL. This operation assigns a share Id that can be used to manage share, see:
- Get basic information about share
- List shares associated with file or directory
- Change name of the share
- Remove share
Any number of shares can be associated with each file or directory.
Example cURL requests
Creates share
curl -H "X-Auth-Token: $TOKEN" -X POST \
-H "Content-type: application/json" \
-d '{ "name": "MyShare", "fileId": $FILE_ID }' \
"https://$HOST/api/v3/oneprovider/shares"
Request body
Share properties.
| Property | Type & Description |
|---|---|
name string The name of the share. | |
description string Description of the share contents, interpreted as markdown format when displayed in GUI. | |
fileId string Id of file or directory to be shared. The whole space can also be shared. | |
Request Examples
{
"name": "MyShare",
"description": "# Top level header\nDescription of the share contents.",
"fileId": "00000000005CF4706775696423745F772D67686431633765446F4D76546D6F2D67575F3361737A7670486B477A7936587734507265584A7723394A4F355F5F396E4C31623031594576776E667431723230677767776C6B497031394E445F6E3868677873"
}Responses
The request has been accepted and the result is the share Id. Also URI of the Share in form https://$HOST/api/v3/oneprovider/shares/{id} is returned in the response Location header.
| Property | Type & Description |
|---|---|
shareId string Share Id. | |
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."
}