Update Sharing
Update publicly shared file or folder.
Endpoint
http
PATCH /api/v1/share/{token}Parameters
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
token | string | yes | - |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
protected | 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 |
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 |
Request example
sh
curl --location --request PATCH 'https://files.ro/api/v1/share/{token}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {token}' \
--data-raw '{
"protected": true,
"password": "test",
"permission": "editor",
"expiration": 1
}'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 permission field for folder is required."
}json
{
"message": "This action is unauthorized."
}