Folders

Attributes
id Integer 1 Unique numeric identifier
name String Folder Name Human readable name identifying this folder at its current tree level (may be repeated in other parent folders)
Actions
List GET /projects/{project_id}/folders -
List children GET /projects/{project_id}/folders?parent_id={parent_folder_id} -
Show GET /projects/{project_id}/folders/{id} -
Create POST /projects/{project_id}/folders/ necessary data: {"folder":{"name":"folder name"}}
Update PUT /projects/{project_id}/folders/{id} necessary data: {"folder":{"name":"new folder name"}}
Destroy DELETE /projects/{project_id}/folders/{id} -
List roles GET /folders/{id}/roles -
Create role POST /folders/{id}/roles necessary data: {"role":{"name":"new role name"}, "permission_ids": []}
Update role PUT /folders/{id}/roles/{role_id} necessary data: {"role":{"name":"new role name"}, "permission_ids": []}
List folder permissions GET /folders/{id}/permissions -
List role permissions GET /folders/{id}/roles/{role_id}/permissions -

Folder items

There are three types of items that can show up in a folder:

  • Files: Raw files of any type
  • Playlists: Collections of clips
  • Galleries: Collections of images

Example:

Creating a new folder within a project. The project would have the id 9:

POST /api/projects/9/folders HTTP/1.1
Authorization: Bearer example-token
Accept: application/json

data: {"folder":{"name":"new folder"}}

response:

HTTP/1.1 201 Created
Content-Type: application/json

{
  "status": 201,
  "status_message": "Created",
  "info": "",
  "data": {"folder":{"id":257,"name":"new folder","project_id":6,"parent_id":null}}
}

Create role with permissions

Example:

Creating a new role with permissions 1, 2 and 3 within a room. The room would have the id 9:

POST /api/folders/9/roles HTTP/1.1
Authorization: Bearer example-token
Accept: application/json

data: {"role":{"name":"new role"}, "permission_ids": [ 1, 2, 3 ]}

response:

HTTP/1.1 201 Created
Content-Type: application/json

{
  "status": 201,
  "status_message": "Created",
  "info": "",
  "data": {"role":{"id":257,"name":"new role"}}
}

Update a role with permissions

Example:

Update role 99 with permissions 1, 2 and 3 within a room. The room would have the id 9:

Existing permissions will be overwritten.

PUT /api/folders/9/roles/99 HTTP/1.1
Authorization: Bearer example-token
Accept: application/json

data: {"role":{"name":"updated role"}, "permission_ids": [ 1, 2, 3 ]}

response:

HTTP/1.1 201 Created
Content-Type: application/json

{
  "status": 204,
  "status_message": "No Content",
  "info": "",
  "data": {"role":{"id":99,"name":"updated role"}}
}