Filesfolders REST API Documentation

This document contains the HTTP REST API documentation for the filesfolders app. For general information on REST API usage in SODAR Core, see REST API Overview.

Filesfolders REST API Versioning

Media Type

application/vnd.bihealth.sodar-core.filesfolders+json

Current Version

1.0

Accepted Versions

1.0

Header Example

Accept: application/vnd.bihealth.sodar-core.filesfolders+json; version=x.y

Filesfolders REST API Views

class filesfolders.views_api.FolderListCreateAPIView(**kwargs)[source]

List folders or create a folder.

Supports optional pagination for listing by providing the page query string. This will return results in the Django Rest Framework PageNumberPagination format.

URL: /files/api/folder/list-create/{Project.sodar_uuid}

Methods: GET, POST

Parameters for GET:

  • page: Page number for paginated results (int, optional)

Parameters for POST:

  • name: Folder name (string)

  • folder: Parent folder UUID (string)

  • owner: User UUID of folder owner (string)

  • flag: Folder flag (string, optional)

  • description: Folder description (string, optional)

class filesfolders.views_api.FolderRetrieveUpdateDestroyAPIView(**kwargs)[source]

Retrieve, update or destroy a folder.

URL: /files/api/folder/retrieve-update-destroy/{Folder.sodar_uuid}

Methods: GET, PUT, PATCH, DELETE

Parameters for PUT and PATCH:

  • name: Folder name (string)

  • folder: Parent folder UUID (string)

  • owner: User UUID of folder owner (string)

  • flag: Folder flag (string, optional)

  • description: Folder description (string, optional)

class filesfolders.views_api.FileListCreateAPIView(**kwargs)[source]

List files or upload a file. For uploads, the request must be made in the multipart format.

Supports optional pagination for listing by providing the page query string. This will return results in the Django Rest Framework PageNumberPagination format.

URL: /files/api/file/list-create/{Project.sodar_uuid}

Methods: GET, POST

Parameters for GET:

  • page: Page number for paginated results (int, optional)

Parameters for POST:

  • name: Folder name (string)

  • folder: Parent folder UUID (string)

  • owner: User UUID of folder owner (string)

  • flag: Folder flag (string, optional)

  • description: Folder description (string, optional)

  • public_url: Allow creation of a publicly viewable URL (bool)

  • file: File to be uploaded

class filesfolders.views_api.FileRetrieveUpdateDestroyAPIView(**kwargs)[source]

Retrieve, update or destroy a file.

URL: /files/api/file/retrieve-update-destroy/{File.sodar_uuid}

Methods: GET, PUT, PATCH, DELETE

Parameters for PUT and PATCH:

  • name: Folder name (string)

  • folder: Parent folder UUID (string)

  • owner: User UUID of folder owner (string)

  • flag: Folder flag (string, optional)

  • description: Folder description (string, optional)

  • public_url: Allow creation of a publicly viewable URL (bool)

  • file: File to be uploaded

class filesfolders.views_api.FileServeAPIView(**kwargs)[source]

Serve the file content.

URL: /files/api/file/serve/{File.sodar_uuid}

Methods: GET

class filesfolders.views_api.HyperLinkListCreateAPIView(**kwargs)[source]

List hyperlinks or create a hyperlink.

Supports optional pagination for listing by providing the page query string. This will return results in the Django Rest Framework PageNumberPagination format.

URL: /files/api/hyperlink/list-create/{Project.sodar_uuid}

Methods: GET, POST

Parameters for GET:

  • page: Page number for paginated results (int, optional)

Parameters for POST:

  • name: Folder name (string)

  • folder: Parent folder UUID (string)

  • owner: User UUID of folder owner (string)

  • flag: Folder flag (string, optional)

  • description: Folder description (string, optional)

  • url: URL for the link (string)

class filesfolders.views_api.HyperLinkRetrieveUpdateDestroyAPIView(**kwargs)[source]

Retrieve, update or destroy a hyperlink.

URL: /files/api/hyperlink/retrieve-update-destroy/{HyperLink.sodar_uuid}

Methods: GET, PUT, PATCH, DELETE

Parameters for PUT and PATCH:

  • name: Folder name (string)

  • folder: Parent folder UUID (string)

  • owner: User UUID of folder owner (string)

  • flag: Folder flag (string, optional)

  • description: Folder description (string, optional)

  • url: URL for the link (string)

Filesfolders REST API Version Changes

v2.0

  • All views
    • Return owner as UUID instead of SODARUserSerializer dict