From 8581d870c68abba69d925c63dee7ce0213f69c7d Mon Sep 17 00:00:00 2001 From: Gev Date: Sat, 15 Apr 2023 23:41:20 +0400 Subject: [PATCH 1/5] Space: Membership Attributes --- controllers/space/MembershipController.php | 8 +++++++- docs/swagger/space.yaml | 10 ++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/controllers/space/MembershipController.php b/controllers/space/MembershipController.php index c91fcbc..2ae59e3 100644 --- a/controllers/space/MembershipController.php +++ b/controllers/space/MembershipController.php @@ -49,7 +49,13 @@ public function actionCreate($spaceId, $userId) return $this->returnError(400, 'You cannot administer this space!'); } - $space->addMember($userId, Yii::$app->request->get('canLeave', true), Yii::$app->request->get('silent', false)); + $space->addMember( + $userId, + Yii::$app->request->get('canLeave', true), + Yii::$app->request->get('silent', false), + Space::USERGROUP_MEMBER, + Yii::$app->request->get('showAtDashboard', true), + ); return $this->returnSuccess('Member added!'); } diff --git a/docs/swagger/space.yaml b/docs/swagger/space.yaml index f61b858..bd32859 100644 --- a/docs/swagger/space.yaml +++ b/docs/swagger/space.yaml @@ -531,6 +531,16 @@ paths: type: boolean description: Send added notification to the user default: false + - in: query + name: canLeave + type: integer + description: '0: user cannot cancel membership | 1: can cancel membership | 2: depending on space flag members_can_leave' + default: 1 + - in: query + name: showAtDashboard + type: boolean + description: Show at dashboard + default: true responses: default: description: Successful operation From f4262bbdf24a2979828338b60e1f970c28729449 Mon Sep 17 00:00:00 2001 From: Gev Date: Sat, 15 Apr 2023 23:48:31 +0400 Subject: [PATCH 2/5] Refactor Bearer Auth --- controllers/space/MembershipController.php | 8 ++++++++ docs/CHANGELOG.md | 1 + 2 files changed, 9 insertions(+) diff --git a/controllers/space/MembershipController.php b/controllers/space/MembershipController.php index 2ae59e3..2d21507 100644 --- a/controllers/space/MembershipController.php +++ b/controllers/space/MembershipController.php @@ -101,6 +101,14 @@ public function actionRole($spaceId, $userId) return $this->returnError(400, 'Invalid role given!'); } + if ($showAtDashboard = Yii::$app->request->get('showAtDashboard')) { + $membership->show_at_dashboard = (int) $showAtDashboard; + } + + if ($canLeave = Yii::$app->request->get('canLeave')) { + $membership->can_cancel_membership = !! $canLeave; + } + $membership->group_id = $newRole; $membership->save(); diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index bdc43a3..4303a87 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,6 +5,7 @@ Changelog ---------------------- - Fix #110: Fix PHP Error in UserDefinition - Enh #106: Allow to set `authclient` and `authclient_id` on user creating and updating +- Enh #116: Allow to set `show_at_dashboard` and `can_cancel_membership` on space membership creating and updating 0.8.0 (March 10, 2023) ---------------------- From 5a0ba103df5c80af93122a1ea66606c4089bf2b3 Mon Sep 17 00:00:00 2001 From: Gev Date: Sat, 15 Apr 2023 23:54:21 +0400 Subject: [PATCH 3/5] Space: Membership Attributes --- controllers/space/MembershipController.php | 8 -------- docs/CHANGELOG.md | 2 +- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/controllers/space/MembershipController.php b/controllers/space/MembershipController.php index 2d21507..2ae59e3 100644 --- a/controllers/space/MembershipController.php +++ b/controllers/space/MembershipController.php @@ -101,14 +101,6 @@ public function actionRole($spaceId, $userId) return $this->returnError(400, 'Invalid role given!'); } - if ($showAtDashboard = Yii::$app->request->get('showAtDashboard')) { - $membership->show_at_dashboard = (int) $showAtDashboard; - } - - if ($canLeave = Yii::$app->request->get('canLeave')) { - $membership->can_cancel_membership = !! $canLeave; - } - $membership->group_id = $newRole; $membership->save(); diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4303a87..b0f715d 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,7 +5,7 @@ Changelog ---------------------- - Fix #110: Fix PHP Error in UserDefinition - Enh #106: Allow to set `authclient` and `authclient_id` on user creating and updating -- Enh #116: Allow to set `show_at_dashboard` and `can_cancel_membership` on space membership creating and updating +- Enh #116: Allow to set `show_at_dashboard` and `can_cancel_membership` on space membership creating 0.8.0 (March 10, 2023) ---------------------- From 1a15dc9e6303686a31003e985302de050366d969 Mon Sep 17 00:00:00 2001 From: Gev Date: Sat, 15 Apr 2023 23:57:33 +0400 Subject: [PATCH 4/5] Space: Membership Attributes --- docs/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index bdc43a3..b0f715d 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,6 +5,7 @@ Changelog ---------------------- - Fix #110: Fix PHP Error in UserDefinition - Enh #106: Allow to set `authclient` and `authclient_id` on user creating and updating +- Enh #116: Allow to set `show_at_dashboard` and `can_cancel_membership` on space membership creating 0.8.0 (March 10, 2023) ---------------------- From 476dcdbc208eedaece7e4b50c8235960c5e84bdc Mon Sep 17 00:00:00 2001 From: Gev Date: Mon, 17 Apr 2023 20:17:54 +0400 Subject: [PATCH 5/5] Space: Membership Attributes --- docs/html/activity.html | 650 ++++++++++++++++----------------- docs/html/auth.html | 636 +++++++++++++++----------------- docs/html/comment.html | 618 ++++++++++++++++--------------- docs/html/common.html | 194 +++++----- docs/html/file.html | 448 ++++++++++++----------- docs/html/like.html | 574 +++++++++++++++-------------- docs/html/notification.html | 654 ++++++++++++++++----------------- docs/html/post.html | 702 +++++++++++++++++------------------ docs/html/space.html | 6 +- docs/html/topic.html | 708 +++++++++++++++++------------------- module.json | 2 +- 11 files changed, 2509 insertions(+), 2683 deletions(-) diff --git a/docs/html/activity.html b/docs/html/activity.html index edd5bf8..1ac2a12 100644 --- a/docs/html/activity.html +++ b/docs/html/activity.html @@ -12,7 +12,7 @@ margin: 0; } - -

HumHub - Activity API (1.0.0)

Download OpenAPI specification:Download

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

Welcome to the HumHub activity module API reference.

-

Authentication

Bearer

Security Scheme Type JWT

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Activity

API to access activity information.

-

Find all global activity

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
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Get activity by id

path Parameters
id
required
integer

The id of activity

-

Responses

Response samples

Content type
{
  • "id": 32,
  • "class": "humhub\\modules\\space\\activities\\MemberAdded",
  • "content": {
    },
  • "originator": {},
  • "source": {},
  • "createdAt": "2019-03-05 15:35:02"
}

Get all activities by container

path Parameters
containerId
required
integer

The id of 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
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}
+ " fill="currentColor">

HumHub - Activity API (1.0.0)

Download OpenAPI specification:Download

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

Welcome to the HumHub activity module API reference.

+

Activity

API to access activity information.

+

Find all global activity

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
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Get activity by id

path Parameters
id
required
integer

The id of activity

+

Responses

Response samples

Content type
{
  • "id": 32,
  • "class": "humhub\\modules\\space\\activities\\MemberAdded",
  • "content": {
    },
  • "originator": {},
  • "source": {},
  • "createdAt": "2019-03-05 15:35:02"
}

Get all activities by container

path Parameters
containerId
required
integer

The id of 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
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}
-

HumHub - Auth API (1.0.0)

Download OpenAPI specification:Download

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

Welcome to the HumHub auth module API reference.

-

Authentication

Login in the application

Request Body schema: application/json

Credentials for login in app

-
username
required
string

Your username or email address

-
password
required
string

Responses

Request samples

Content type
application/json
{
  • "username": "username@example.com",
  • "password": "password"
}

Response samples

Content type
{
  • "code": 200,
  • "message": "string",
  • "auth_token": "eyJ0eXAiOiJKV1QiLC .... tE_7_rLSX3vA",
  • "expired_at": "string"
}

User

Get current user

Responses

Response samples

Content type
application/json
{
  • "id": 14,
  • "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
  • "display_name": "John Doe",
  • "account": {
    },
  • "profile": {
    }
}
+ " fill="currentColor">

HumHub - Auth API (1.0.0)

Download OpenAPI specification:Download

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

Welcome to the HumHub auth module API reference.

+

Authentication

Login in the application

Request Body schema: application/json

Credentials for login in app

+
username
required
string

Your username or email address

+
password
required
string

Responses

Request samples

Content type
application/json
{
  • "username": "username@example.com",
  • "password": "password"
}

Response samples

Content type
{
  • "code": 200,
  • "message": "string",
  • "auth_token": "eyJ0eXAiOiJKV1QiLC .... tE_7_rLSX3vA",
  • "expired_at": "string"
}

User

Get current user

Responses

Response samples

Content type
application/json
{
  • "id": 14,
  • "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
  • "display_name": "John Doe",
  • "account": {
    },
  • "profile": {
    }
}
-

HumHub - Content API (1.0.0)

Download OpenAPI specification:Download

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

Welcome to the HumHub comment module API reference.

-

Authentication

Bearer

Security Scheme Type JWT

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Find comments by object

query Parameters
objectModel
required
string

The object model class name

-
objectId
required
integer

The primary key of the object

-

Responses

Response samples

Content type
application/json
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Find comments by content

path Parameters
id
required
integer

The primary key of the content

-

Responses

Response samples

Content type
application/json
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Create a comment

Request Body schema: application/json

The comment data

-
objectModel
required
string
objectId
required
integer <int64>
required
object (Comment)

Responses

Request samples

Content type
application/json
{
  • "objectModel": "humhub\\modules\\post\\models\\Post",
  • "objectId": 123,
  • "Comment": {
    }
}

Response samples

Content type
application/json
{
  • "id": 14,
  • "message": "Calvin Klein – Between love and madness lies obsession.",
  • "objectModel": "humhub\\modules\\post\\models\\Post",
  • "objectId": 123,
  • "createdBy": {},
  • "createdAt": "2018-08-09 14:22:03",
  • "commentsCount": 5,
  • "comments": [
    ]
}

Get comment by id

path Parameters
id
required
integer

The id of the comment

-

Responses

Response samples

Content type
application/json
{
  • "id": 14,
  • "message": "Calvin Klein – Between love and madness lies obsession.",
  • "objectModel": "humhub\\modules\\post\\models\\Post",
  • "objectId": 123,
  • "createdBy": {},
  • "createdAt": "2018-08-09 14:22:03",
  • "commentsCount": 5,
  • "comments": [
    ]
}

Update a comment by id

path Parameters
id
required
integer

Id of the updated comment

-
Request Body schema: application/json

The comment data

-
required
object (Comment)

Responses

Request samples

Content type
application/json
{
  • "Comment": {
    }
}

Response samples

Content type
application/json
{
  • "id": 14,
  • "message": "Calvin Klein – Between love and madness lies obsession.",
  • "objectModel": "humhub\\modules\\post\\models\\Post",
  • "objectId": 123,
  • "createdBy": {},
  • "createdAt": "2018-08-09 14:22:03",
  • "commentsCount": 5,
  • "comments": [
    ]
}

Deletes a comment by id

path Parameters
id
required
integer

The id of comment

-

Responses

+ " fill="currentColor">

HumHub - Content API (1.0.0)

Download OpenAPI specification:Download

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

Welcome to the HumHub comment module API reference.

+

Find comments by object

query Parameters
objectModel
required
string

The object model class name

+
objectId
required
integer

The primary key of the object

+

Responses

Response samples

Content type
application/json
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Find comments by content

path Parameters
id
required
integer

The primary key of the content

+

Responses

Response samples

Content type
application/json
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Create a comment

Request Body schema: application/json

The comment data

+
objectModel
required
string
objectId
required
integer <int64>
required
object (Comment)

Responses

Request samples

Content type
application/json
{
  • "objectModel": "humhub\\modules\\post\\models\\Post",
  • "objectId": 123,
  • "Comment": {
    }
}

Response samples

Content type
application/json
{
  • "id": 14,
  • "message": "Calvin Klein – Between love and madness lies obsession.",
  • "objectModel": "humhub\\modules\\post\\models\\Post",
  • "objectId": 123,
  • "createdBy": {},
  • "createdAt": "2018-08-09 14:22:03",
  • "commentsCount": 5,
  • "comments": [
    ]
}

Get comment by id

path Parameters
id
required
integer

The id of the comment

+

Responses

Response samples

Content type
application/json
{
  • "id": 14,
  • "message": "Calvin Klein – Between love and madness lies obsession.",
  • "objectModel": "humhub\\modules\\post\\models\\Post",
  • "objectId": 123,
  • "createdBy": {},
  • "createdAt": "2018-08-09 14:22:03",
  • "commentsCount": 5,
  • "comments": [
    ]
}

Update a comment by id

path Parameters
id
required
integer

Id of the updated comment

+
Request Body schema: application/json

The comment data

+
required
object (Comment)

Responses

Request samples

Content type
application/json
{
  • "Comment": {
    }
}

Response samples

Content type
application/json
{
  • "id": 14,
  • "message": "Calvin Klein – Between love and madness lies obsession.",
  • "objectModel": "humhub\\modules\\post\\models\\Post",
  • "objectId": 123,
  • "createdBy": {},
  • "createdAt": "2018-08-09 14:22:03",
  • "commentsCount": 5,
  • "comments": [
    ]
}

Deletes a comment by id

path Parameters
id
required
integer

The id of comment

+

Responses

-

Download OpenAPI specification:Download

Authentication

Bearer

Security Scheme Type JWT

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic
+ " fill="currentColor">

Download OpenAPI specification:Download

-

HumHub - File API (1.0.0)

Download OpenAPI specification:Download

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

Welcome to the HumHub file module API reference.

-

Authentication

Bearer

Security Scheme Type JWT

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Downloads a file by id

path Parameters
id
required
integer

The id of the file to download

-

Responses

+ " fill="currentColor">

HumHub - File API (1.0.0)

Download OpenAPI specification:Download

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

Welcome to the HumHub file module API reference.

+

Downloads a file by id

path Parameters
id
required
integer

The id of the file to download

+

Responses

-

HumHub - Like API (1.0.0)

Download OpenAPI specification:Download

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

Welcome to the HumHub like module API reference.

-

Authentication

Bearer

Security Scheme Type JWT

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Get like by id

path Parameters
id
required
integer

The id of the like

-

Responses

Response samples

Content type
application/json
{}

Deletes a like by id

path Parameters
id
required
integer

The id of the like

-

Responses

Get all likes by content id

query Parameters
model
required
string

The model record class

-
pk
required
integer

The primary key of the record

-

Responses

Response samples

Content type
application/json
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": []
}
+ " fill="currentColor">

HumHub - Like API (1.0.0)

Download OpenAPI specification:Download

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

Welcome to the HumHub like module API reference.

+

Get like by id

path Parameters
id
required
integer

The id of the like

+

Responses

Response samples

Content type
application/json
{}

Deletes a like by id

path Parameters
id
required
integer

The id of the like

+

Responses

Get all likes by content id

query Parameters
model
required
string

The model record class

+
pk
required
integer

The primary key of the record

+

Responses

Response samples

Content type
application/json
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": []
}
-

HumHub - Notification API (1.0.0)

Download OpenAPI specification:Download

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

Welcome to the HumHub notification module API reference.

-

Authentication

Bearer

Security Scheme Type JWT

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Notification

API to access notification information.

-

Find all user notifications

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.

-
excludeFilters
Array of strings
Items Enum: "admin" "calendar" "task" "task_reminder" "comments" "content_created" "like" "space_member" "followed" "mentioned"

Filters to exclude notifications from result.

-

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Get notification by id

path Parameters
id
required
integer

The id of notification

-

Responses

Response samples

Content type
{
  • "id": 32,
  • "class": "humhub\\modules\\content\\notifications\\ContentCreated",
  • "output": "<strong>John Smith</strong> created post \"Calvin Klein – Between love and madness lies obsession.\"",
  • "originator": {},
  • "source": {},
  • "createdAt": "2019-03-05 15:35:02"
}

Find unseen user notifications

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
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Mark all notifications as seen

Responses

Response samples

Content type
{
  • "code": 200,
  • "message": "All notifications successfully marked as seen"
}
+ " fill="currentColor">

HumHub - Notification API (1.0.0)

Download OpenAPI specification:Download

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

Welcome to the HumHub notification module API reference.

+

Notification

API to access notification information.

+

Find all user notifications

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.

+
excludeFilters
Array of strings
Items Enum: "admin" "calendar" "task" "task_reminder" "comments" "content_created" "like" "space_member" "followed" "mentioned"

Filters to exclude notifications from result.

+

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Get notification by id

path Parameters
id
required
integer

The id of notification

+

Responses

Response samples

Content type
{
  • "id": 32,
  • "class": "humhub\\modules\\content\\notifications\\ContentCreated",
  • "output": "<strong>John Smith</strong> created post \"Calvin Klein – Between love and madness lies obsession.\"",
  • "originator": {},
  • "source": {
    },
  • "createdAt": "2019-03-05 15:35:02"
}

Find unseen user notifications

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
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Mark all notifications as seen

Responses

Response samples

Content type
{
  • "code": 200,
  • "message": "All notifications successfully marked as seen"
}
-

HumHub - Post API (1.0.0)

Download OpenAPI specification:Download

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

Welcome to the HumHub post module API reference.

-

Authentication

Bearer

Security Scheme Type JWT

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Find all posts by container

path Parameters
id
required
integer

ID of content container

-
query Parameters
topics
string
Example: topics=Music,Dancing

Coma separated list of topics to filter

-
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
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Creates a new post

path Parameters
id
required
integer

ID of content container to post to

-
Request Body schema: application/json

The post

-
required
object (Post)

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "id": 14,
  • "message": "Calvin Klein – Between love and madness lies obsession.",
  • "content": {}
}

Find all posts

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
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Get post by id

path Parameters
id
required
integer

The id of the post

-

Responses

Response samples

Content type
application/json
{
  • "id": 14,
  • "message": "Calvin Klein – Between love and madness lies obsession.",
  • "content": {}
}

Updates a post by id

path Parameters
id
required
integer

The id of post

-
Request Body schema: application/json

The post

-
required
object (Post)

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "id": 14,
  • "message": "Calvin Klein – Between love and madness lies obsession.",
  • "content": {}
}

Deletes a post by id

path Parameters
id
required
integer

The id of post

-

Responses

Upload files to Post by id

path Parameters
id
required
integer

The id of the Post

-
Request Body schema: multipart/form-data
hiddenInStream
Array of any[ items ]

Names of the attached files which should be hidden in stream

-
files
required
Array of file[ items ]

The files to upload.

-

Responses

Response samples

Content type
application/json
{}
+ " fill="currentColor">

HumHub - Post API (1.0.0)

Download OpenAPI specification:Download

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

Welcome to the HumHub post module API reference.

+

Find all posts by container

path Parameters
id
required
integer

ID of content container

+
query Parameters
topics
string
Example: topics=Music,Dancing

Coma separated list of topics to filter

+
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
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Creates a new post

path Parameters
id
required
integer

ID of content container to post to

+
Request Body schema: application/json

The post

+
required
object (Post)

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "id": 14,
  • "message": "Calvin Klein – Between love and madness lies obsession.",
  • "content": {
    }
}

Find all posts

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
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Get post by id

path Parameters
id
required
integer

The id of the post

+

Responses

Response samples

Content type
application/json
{
  • "id": 14,
  • "message": "Calvin Klein – Between love and madness lies obsession.",
  • "content": {
    }
}

Updates a post by id

path Parameters
id
required
integer

The id of post

+
Request Body schema: application/json

The post

+
required
object (Post)

Responses

Request samples

Content type
application/json
{
  • "data": {
    }
}

Response samples

Content type
application/json
{
  • "id": 14,
  • "message": "Calvin Klein – Between love and madness lies obsession.",
  • "content": {
    }
}

Deletes a post by id

path Parameters
id
required
integer

The id of post

+

Responses

Upload files to Post by id

path Parameters
id
required
integer

The id of the Post

+
Request Body schema: multipart/form-data
hiddenInStream
Array of any

Names of the attached files which should be hidden in stream

+
files
required
Array of file

The files to upload.

+

Responses

Response samples

Content type
application/json
{}
-

HumHub - Topic API (1.0.0)

Download OpenAPI specification:Download

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

Welcome to the HumHub topic module API reference.

-

Authentication

Bearer

Security Scheme Type JWT

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Topic

API to access and manage topic information.

-

Find all topics

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
{
  • "total": 76,
  • "page": 1,
  • "results": [
    ]
}

Get topic by id

path Parameters
id
required
integer

The id of topic

-

Responses

Response samples

Content type
{
  • "id": 1,
  • "name": "Api topic"
}

Update existing topic

path Parameters
id
required
integer

The id of topic

-
Request Body schema: application/json

Topic name

-
name
string

Responses

Request samples

Content type
application/json
{
  • "name": "Api topic"
}

Response samples

Content type
{
  • "id": 1,
  • "name": "Api topic"
}

Delete topic by id

path Parameters
id
required
integer

The id of topic

-

Responses

Response samples

Content type
{
  • "code": 200,
  • "message": "Topic successfully deleted!"
}

Get all topics by container

path Parameters
containerId
required
integer

The id of 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
{
  • "total": 76,
  • "page": 1,
  • "results": [
    ]
}

Create new topic

path Parameters
containerId
required
integer

The id of container

-
Request Body schema: application/json

Topic info

-
name
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "Api topic"
}

Response samples

Content type
{
  • "id": 1,
  • "name": "Api topic"
}
+ " fill="currentColor">

HumHub - Topic API (1.0.0)

Download OpenAPI specification:Download

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

Welcome to the HumHub topic module API reference.

+

Topic

API to access and manage topic information.

+

Find all topics

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
{
  • "total": 76,
  • "page": 1,
  • "results": [
    ]
}

Get topic by id

path Parameters
id
required
integer

The id of topic

+

Responses

Response samples

Content type
{
  • "id": 1,
  • "name": "Api topic"
}

Update existing topic

path Parameters
id
required
integer

The id of topic

+
Request Body schema: application/json

Topic name

+
name
string

Responses

Request samples

Content type
application/json
{
  • "name": "Api topic"
}

Response samples

Content type
{
  • "id": 1,
  • "name": "Api topic"
}

Delete topic by id

path Parameters
id
required
integer

The id of topic

+

Responses

Response samples

Content type
{
  • "code": 200,
  • "message": "Topic successfully deleted!"
}

Get all topics by container

path Parameters
containerId
required
integer

The id of 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
{
  • "total": 76,
  • "page": 1,
  • "results": [
    ]
}

Create new topic

path Parameters
containerId
required
integer

The id of container

+
Request Body schema: application/json

Topic info

+
name
required
string

Responses

Request samples

Content type
application/json
{
  • "name": "Api topic"
}

Response samples

Content type
{
  • "id": 1,
  • "name": "Api topic"
}