Restaurează element
Restaurează unul sau mai multe fișiere ori foldere din coș.
Endpoint
http
POST /api/v1/trash/restoreParametri
Parametri body
| Parametru | Tip | Obligatoriu | Descriere |
|---|---|---|---|
to_home | boolean | yes | Dacă valoarea este true, conținutul restaurat va fi mutat în directorul principal. |
items | array | yes | Lista de elemente care trebuie restaurate. |
items.*.type | string | yes | Tipul elementului restaurat. Tipuri permise: folder sau file. |
items.*.id | uuid | yes | ID-ul elementului restaurat. |
Exemplu de cerere
sh
curl --location --request POST 'https://files.ro/api/v1/trash/restore' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {token}' \
--data-raw '{
"to_home": true,
"items": [
{
"type": "folder",
"id": "{item_id}"
}
]
}'Răspuns
json
{
"type": "success",
"message": "The item was successfully restored."
}json
{
"type": "error",
"message": "You are not authorized"
}json
{
"message": "The given data was invalid.",
"errors": {
"field": [
"The field is required."
]
}
}