Share Item
Share publicly file or folder.
Endpoint
http
POST /api/v1/shareParameters
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
id | uuid | yes | The id of the item you want to share |
isPassword | boolean | - | Determine if the folder would be publicly shared or privately secured with the password |
password | string | required when ispassword:yes | The password which protect the content stored in the folder |
type | string | yes | The type of the renaming item. Allowed types are folder or file |
permission | string | required when is folder | The edit permissions for the folder. Allowed permission types are editor or visitor. |
expiration | integer | - | The time in hours the link expire automatically |
emails | array | - | The array of the valid email adresses |
Request example
sh
curl --location --request POST 'https://files.ro/api/v1/share' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {token}' \
--data-raw '{
"id": "{item_id}",
"isPassword": true,
"password": "secret_password",
"type": "folder",
"permission": "editor",
"expiration": 1,
"emails": [
"jane@doe.com"
]
}'Response
json
{
"data": {
"id": "share_123",
"type": "shared",
"attributes": {
"permission": "editor",
"protected": false,
"item_id": "item_123",
"expire_in": 24,
"token": "share_token",
"link": "https://files.ro/share/share_token",
"type": "folder"
}
}
}json
{
"type": "error",
"message": "The item is currently shared."
}json
{
"type": "error",
"message": "The permission field for folder is required."
}json
{
"message": "This action is unauthorized."
}