Creeaza folder de echipă
Creeaza un folder de echipă nou și invita membri noi.
Endpoint
http
POST /api/v1/teams/foldersParametri
Parametri body
| Parametru | Tip | Obligatoriu | Descriere |
|---|---|---|---|
name | string | yes | Numele folderului de echipă. |
invitations | array | yes | Lista de invitații care specifică pe cine inviți în folderul de echipă. |
invitations.*.email | string | yes | Adresa de email a utilizatorului |
invitations.*.permission | string | yes | Permisiunea pentru utilizator. Poate fi can-edit sau can-view. |
invitations.*.type | string | yes | Tipul obiectului, valoarea invitation este obligatorie. |
Exemplu de cerere
sh
curl --location --request POST 'https://files.ro/api/v1/teams/folders' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {token}' \
--data-raw '{
"name": "Team API",
"invitations": [
{
"email": "jane@doe.com",
"permission": "can-edit",
"type": "invitation"
}
]
}'Răspuns
json
{
"data": {
"id": "folder_123",
"type": "folder",
"attributes": {
"name": "Projects",
"color": "#00BC7E",
"emoji": null,
"filesize": 12345678,
"isTeamFolder": false,
"items": 12,
"trashed_items": 0,
"created_at": "01. Jan. 2024",
"updated_at": "02. Jan. 2024",
"deleted_at": null
},
"relationships": {
"shared": {
"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"
}
}
},
"parent": {
"data": {
"type": "folder",
"id": "folder_root",
"attributes": {
"name": "Root"
}
}
},
"user": {
"data": {
"type": "user",
"id": "user_123",
"attributes": {
"name": "Jane Doe",
"avatar": "https://files.ro/storage/avatars/jane.png",
"color": "#00BC7E"
}
}
}
}
}
}json
{
"type": "error",
"message": "This user action is not allowed."
}json
{
"type": "error",
"message": "You exceed your members limit."
}json
{
"type": "error",
"message": "You are not authorized"
}json
{
"message": "The given data was invalid.",
"errors": {
"field": [
"The field is required."
]
}
}