HumHub - cFiles API (1.0.0)

Download OpenAPI specification:Download

E-mail: info@humhub.com License: AGPLv2

Welcome to the HumHub cFiles module API reference.

Authentication

Bearer

Security Scheme Type JWT

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Directory

Find all folders by content container

path Parameters
id
required
integer

The id of content container

query Parameters
page
string >= 0

The number of page of the result set.

limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

Responses

Response samples

Content type
{}

Create new directory

path Parameters
id
required
integer

The id of content container

Request Body schema: application/json

Directory information

target_id
required
integer <int64>
required
object

Responses

Request samples

Content type
application/json
{
  • "target_id": 1,
  • "Folder": {
    }
}

Response samples

Content type
application/json
{}

Get directory by id

path Parameters
id
required
integer

The id of directory

Responses

Response samples

Content type
application/json
{}

Update directory by id

path Parameters
id
required
integer

The id of the directory

Request Body schema: application/json

Directory information

target_id
required
integer <int64>
required
object

Responses

Request samples

Content type
application/json
{
  • "target_id": 1,
  • "Folder": {
    }
}

Response samples

Content type
application/json
{}

Deletes a directory by id

path Parameters
id
required
integer

The id of directory

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Selected items are successfully deleted!"
}

File

Find all files by content container

path Parameters
id
required
integer

The id of content container

query Parameters
page
string >= 0

The number of page of the result set.

limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

Responses

Response samples

Content type
{}

Upload files

path Parameters
id
required
integer

The id of content container

Request Body schema: application/x-www-form-urlencoded
folder_id
required
integer <int64>

Id of directory

files
required
Array of file

The files to upload.

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Files successfully uploaded!"
}

Get file info by id

path Parameters
id
required
integer

The id of file

Responses

Response samples

Content type
application/json
{}

Deletes a file by id

path Parameters
id
required
integer

The id of file

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Successfully deleted!"
}

Items Management

Make items public

path Parameters
id
required
integer

The id of content container

Request Body schema: application/json

Array of items

selection
required
Array of strings (Selection)

Item id in format {type}_{id}

Responses

Request samples

Content type
application/json
{
  • "selection": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Items successfully marked public!"
}

Make items private

path Parameters
id
required
integer

The id of content container

Request Body schema: application/json

Array of items

selection
required
Array of strings (Selection)

Item id in format {type}_{id}

Responses

Request samples

Content type
application/json
{
  • "selection": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Items successfully marked private!"
}

Move items to another folder

path Parameters
id
required
integer

The id of content container

Request Body schema: application/json

Directory information

source_id
required
integer <int64>
required
object
selection
required
Array of strings (Selection)

Item id in format {type}_{id}

Responses

Request samples

Content type
application/json
{
  • "source_id": 14,
  • "MoveForm": {
    },
  • "selection": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Items successfully moved."
}

Delete items from folder

path Parameters
id
required
integer

The id of content container

Request Body schema: application/json

Array of items

selection
required
Array of strings (Selection)

Item id in format {type}_{id}

Responses

Request samples

Content type
application/json
{
  • "selection": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Selected items are successfully deleted!"
}