diff --git a/Events.php b/Events.php index fdbf4f3..5642ad3 100644 --- a/Events.php +++ b/Events.php @@ -31,6 +31,7 @@ public static function onBeforeRequest($event) // Auth ['pattern' => 'auth/login', 'route' => 'rest/auth/auth/index', 'verb' => ['POST']], + ['pattern' => 'auth/impersonate', 'route' => 'rest/auth/auth/impersonate', 'verb' => ['POST']], ['pattern' => 'auth/current', 'route' => 'rest/auth/auth/current', 'verb' => ['GET', 'HEAD']], // User: Default Controller diff --git a/components/BaseController.php b/components/BaseController.php index b5968bd..7c64741 100644 --- a/components/BaseController.php +++ b/components/BaseController.php @@ -7,6 +7,7 @@ namespace humhub\modules\rest\components; +use humhub\modules\rest\components\auth\ImpersonateAuth; use Yii; use yii\data\Pagination; use yii\db\ActiveQuery; @@ -75,6 +76,9 @@ public function behaviors() return null; }, ]] : [], + [[ + 'class' => ImpersonateAuth::class, + ]] ), ], ], parent::behaviors()); diff --git a/components/auth/ImpersonateAuth.php b/components/auth/ImpersonateAuth.php new file mode 100644 index 0000000..c996420 --- /dev/null +++ b/components/auth/ImpersonateAuth.php @@ -0,0 +1,59 @@ +getHeaders()->get($this->header); + + if ($authHeader !== null) { + if ($this->pattern !== null) { + if (preg_match($this->pattern, $authHeader, $matches)) { + $authHeader = $matches[1]; + } else { + return null; + } + + if (!StringHelper::startsWith($authHeader, 'impersonate-')) { + return null; + } + } + + $accessToken = ImpersonateAuthToken::find() + ->where(['token' => $authHeader]) + ->andWhere(['>', 'expiration', new Expression('NOW()')]) + ->one(); + + if ($accessToken && ($identity = $accessToken->user)) { + $user->login($identity); + } else { + $identity = null; + } + + if ($identity === null) { + $this->challenge($response); + $this->handleFailure($response); + } + + return $identity; + } + + return null; + } +} diff --git a/controllers/auth/AuthController.php b/controllers/auth/AuthController.php index fd7442e..99212cb 100644 --- a/controllers/auth/AuthController.php +++ b/controllers/auth/AuthController.php @@ -10,18 +10,21 @@ use Firebase\JWT\JWT; use humhub\modules\rest\components\BaseController; use humhub\modules\rest\definitions\UserDefinitions; +use humhub\modules\rest\models\ImpersonateAuthToken; use humhub\modules\rest\models\JwtAuthForm; use humhub\modules\user\models\forms\Login; use humhub\modules\user\models\User; use humhub\modules\user\services\AuthClientService; use Yii; +use yii\web\ForbiddenHttpException; use yii\web\JsonParser; +use yii\web\NotFoundHttpException; class AuthController extends BaseController { public function beforeAction($action) { - if ($action->id == 'current') { + if (in_array($action->id, ['current', 'impersonate'])) { return parent::beforeAction($action); } @@ -92,4 +95,30 @@ public function actionCurrent() return UserDefinitions::getUser($user); } + + public function actionImpersonate() + { + if (!Yii::$app->user->isAdmin()) { + throw new ForbiddenHttpException(); + } + + $user = User::findOne(['id' => Yii::$app->request->getBodyParam('userId')]); + + if ($user === null) { + throw new NotFoundHttpException(); + } + + if ($token = ImpersonateAuthToken::findOne(['user_id' => $user->id])) { + $token->delete(); + } + + $token = new ImpersonateAuthToken(); + $token->user_id = $user->id; + $token->save(); + + return [ + 'token' => $token->token, + 'expires' => $token->expiration, + ]; + } } diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4f88f47..28a87cb 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -6,6 +6,7 @@ Changelog - Fix #110: Fix PHP Error in UserDefinition - Enh #106: Allow to set `authclient` and `authclient_id` on user creating and updating - Enh #112: Added support of HttpBearer and QueryParam auth methods +- Enh #117: Added support of user Impersonate 0.8.0 (March 10, 2023) ---------------------- 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; } -
-Download OpenAPI specification:Download
Welcome to the HumHub activity module API reference.
+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. + |
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 32,
- "class": "humhub\\modules\\space\\activities\\MemberAdded",
- "content": {
- "id": 12,
- "guid": "3c66dc40-6157-4b9e-a3cd-b2bdba69614d",
- "pinned": false,
- "archived": false,
- "output": "<strong>John Smith</strong> joined the space <strong>Welcome Space</strong>"
}, - "originator": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "source": {
- "id": 1,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "name": "Welcome Space",
- "description": "Your first sample space to discover the platform.",
}, - "createdAt": "2019-03-05 15:35:02"
}
]
}
{- "id": 32,
- "class": "humhub\\modules\\space\\activities\\MemberAdded",
- "content": {
- "id": 12,
- "guid": "3c66dc40-6157-4b9e-a3cd-b2bdba69614d",
- "pinned": false,
- "archived": false,
- "output": "<strong>John Smith</strong> joined the space <strong>Welcome Space</strong>"
}, - "originator": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "source": {
- "id": 1,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "name": "Welcome Space",
- "description": "Your first sample space to discover the platform.",
}, - "createdAt": "2019-03-05 15:35:02"
}
containerId required | integer The id of container + |
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. + |
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 32,
- "class": "humhub\\modules\\space\\activities\\MemberAdded",
- "content": {
- "id": 12,
- "guid": "3c66dc40-6157-4b9e-a3cd-b2bdba69614d",
- "pinned": false,
- "archived": false,
- "output": "<strong>John Smith</strong> joined the space <strong>Welcome Space</strong>"
}, - "originator": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "source": {
- "id": 1,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "name": "Welcome Space",
- "description": "Your first sample space to discover the platform.",
}, - "createdAt": "2019-03-05 15:35:02"
}
]
}
Download OpenAPI specification:Download
Welcome to the HumHub auth module API reference.
-Credentials for login in app
-username required | string Your username or email address - |
password required | string |
{- "username": "username@example.com",
- "password": "password"
}
{- "code": 200,
- "message": "string",
- "auth_token": "eyJ0eXAiOiJKV1QiLC .... tE_7_rLSX3vA",
- "expired_at": "string"
}
{- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
- "account": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "username": "john.doe",
- "email": "john.doe@example.com",
- "visibility": 0,
- "status": 1,
- "tags": [
- "Administration",
- "Support",
- "HumHub"
], - "language": "DE",
- "time_zone": "Europe/Paris",
- "contentcontainer_id": 5
}, - "profile": {
- "firstname": "John",
- "lastname": "Doe",
- "title": "Test user",
- "gender": "male",
- "street": "New Street 5",
- "zip": 80331,
- "city": "Munich",
- "country": "DE (ISO 3166 code)",
- "state": "string",
- "birthday_hide_year": 0,
- "birthday": "1990-01-01",
- "about": "string",
- "phone_private": "string",
- "phone_work": "string",
- "mobile": "string",
- "fax": "string",
- "im_skype": "string",
- "im_xmpp": "string",
- "url": "string",
- "url_facebook": "string",
- "url_linkedin": "string",
- "url_xing": "string",
- "url_youtube": "string",
- "url_vimeo": "string",
- "url_flickr": "string",
- "url_myspace": "string",
- "url_twitter": "string"
}
}
Download OpenAPI specification:Download
Welcome to the HumHub auth module API reference.
+Credentials for login in app
+username required | string Your username or email address + |
password required | string |
{- "username": "username@example.com",
- "password": "password"
}
{- "code": 200,
- "message": "string",
- "auth_token": "eyJ0eXAiOiJKV1QiLC .... tE_7_rLSX3vA",
- "expired_at": "string"
}
{- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
- "account": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "username": "john.doe",
- "email": "john.doe@example.com",
- "visibility": 0,
- "status": 1,
- "tags": [
- "Administration",
- "Support",
- "HumHub"
], - "language": "DE",
- "time_zone": "Europe/Paris",
- "contentcontainer_id": 5,
- "authclient": "local",
- "authclient_id": "0123456789"
}, - "profile": {
- "firstname": "John",
- "lastname": "Doe",
- "title": "Test user",
- "gender": "male",
- "street": "New Street 5",
- "zip": 80331,
- "city": "Munich",
- "country": "DE (ISO 3166 code)",
- "state": "string",
- "birthday_hide_year": 0,
- "birthday": "1990-01-01",
- "about": "string",
- "phone_private": "string",
- "phone_work": "string",
- "mobile": "string",
- "fax": "string",
- "im_skype": "string",
- "im_xmpp": "string",
- "url": "string",
- "url_facebook": "string",
- "url_linkedin": "string",
- "url_xing": "string",
- "url_youtube": "string",
- "url_vimeo": "string",
- "url_flickr": "string",
- "url_myspace": "string",
- "url_twitter": "string"
}
}
id of user to Impersonate
+userId required | integer id of user to Impersonate + |
{- "userId": 1
}
{- "token": "impersonate-YvyEVcbzCvg0wLjb9yXylj1bkbotlCwkKjNKTZD9xeMO86o1G-V9p-wklm5pUdXhdkSGj5dk-l",
- "expires": 1681671865
}
Download OpenAPI specification:Download
Welcome to the HumHub comment module API reference.
-objectModel required | string The object model class name - |
objectId required | integer The primary key of the object - |
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
]
}
id required | integer The primary key of the content - |
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
]
}
The comment data
-objectModel required | string |
objectId required | integer <int64> |
required | object (Comment) |
{- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "Comment": {
- "message": "Calvin Klein – Between love and madness lies obsession."
}
}
{- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
{- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
id required | integer Id of the updated comment - |
The comment data
- required | object (Comment) |
{- "Comment": {
- "message": "Calvin Klein – Between love and madness lies obsession."
}
}
{- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
Download OpenAPI specification:Download
Welcome to the HumHub comment module API reference.
+objectModel required | string The object model class name + |
objectId required | integer The primary key of the object + |
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
]
}
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
]
}
The comment data
+objectModel required | string |
objectId required | integer <int64> |
required | object (Comment) |
{- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "Comment": {
- "message": "Calvin Klein – Between love and madness lies obsession."
}
}
{- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
{- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
id required | integer Id of the updated comment + |
The comment data
+required | object (Comment) |
{- "Comment": {
- "message": "Calvin Klein – Between love and madness lies obsession."
}
}
{- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
Download OpenAPI specification:Download
Download OpenAPI specification:Download
Download OpenAPI specification:Download
Welcome to the HumHub file module API reference.
-Download OpenAPI specification:Download
Welcome to the HumHub file module API reference.
+Download OpenAPI specification:Download
Welcome to the HumHub like module API reference.
-{- "id": 42,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03"
}
model required | string The model record class - |
pk required | integer The primary key of the record - |
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 42,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03"
}
]
}
Download OpenAPI specification:Download
Welcome to the HumHub like module API reference.
+{- "id": 42,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03"
}
model required | string The model record class + |
pk required | integer The primary key of the record + |
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 42,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03"
}
]
}
Download OpenAPI specification:Download
Welcome to the HumHub notification module API reference.
-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. - |
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 32,
- "class": "humhub\\modules\\content\\notifications\\ContentCreated",
- "output": "<strong>John Smith</strong> created post \"Calvin Klein – Between love and madness lies obsession.\"",
- "originator": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "source": {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": null,
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03"
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": {
- "topic": {
- "id": 135,
- "name": "News"
}
}
}
}, - "createdAt": "2019-03-05 15:35:02"
}
]
}
{- "id": 32,
- "class": "humhub\\modules\\content\\notifications\\ContentCreated",
- "output": "<strong>John Smith</strong> created post \"Calvin Klein – Between love and madness lies obsession.\"",
- "originator": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "source": {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": null,
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03"
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": {
- "topic": {
- "id": 135,
- "name": "News"
}
}
}
}, - "createdAt": "2019-03-05 15:35:02"
}
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. - |
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 32,
- "class": "humhub\\modules\\content\\notifications\\ContentCreated",
- "output": "<strong>John Smith</strong> created post \"Calvin Klein – Between love and madness lies obsession.\"",
- "originator": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "source": {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": null,
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03"
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": {
- "topic": {
- "id": 135,
- "name": "News"
}
}
}
}, - "createdAt": "2019-03-05 15:35:02"
}
]
}
Download OpenAPI specification:Download
Welcome to the HumHub notification module API reference.
+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. + |
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 32,
- "class": "humhub\\modules\\content\\notifications\\ContentCreated",
- "output": "<strong>John Smith</strong> created post \"Calvin Klein – Between love and madness lies obsession.\"",
- "originator": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "source": {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2022-05-21 06:20:18",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}, - "createdAt": "2019-03-05 15:35:02"
}
]
}
{- "id": 32,
- "class": "humhub\\modules\\content\\notifications\\ContentCreated",
- "output": "<strong>John Smith</strong> created post \"Calvin Klein – Between love and madness lies obsession.\"",
- "originator": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "source": {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2022-05-21 06:20:18",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}, - "createdAt": "2019-03-05 15:35:02"
}
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. + |
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 32,
- "class": "humhub\\modules\\content\\notifications\\ContentCreated",
- "output": "<strong>John Smith</strong> created post \"Calvin Klein – Between love and madness lies obsession.\"",
- "originator": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "source": {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2022-05-21 06:20:18",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}, - "createdAt": "2019-03-05 15:35:02"
}
]
}
Download OpenAPI specification:Download
Welcome to the HumHub post module API reference.
-id required | integer ID of content container - |
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. - |
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03"
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}
]
}
id required | integer ID of content container to post to - |
The post
- required | object (Post) |
{- "data": {
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false
}, - "topics": [
- {
- "name": "News"
}
]
}
}
}
{- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03"
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}
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. - |
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03"
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}
]
}
{- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03"
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}
id required | integer The id of post - |
The post
- required | object (Post) |
{- "data": {
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false
}, - "topics": [
- {
- "name": "News"
}
]
}
}
}
{- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03"
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}
id required | integer The id of the Post - |
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. - |
{- "files": [
- {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}
]
}
Download OpenAPI specification:Download
Welcome to the HumHub post module API reference.
+id required | integer ID of content container + |
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. + |
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2022-05-21 06:20:18",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}
]
}
id required | integer ID of content container to post to + |
The post
+required | object (Post) |
{- "data": {
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false
}, - "topics": [
- {
- "name": "News"
}
]
}
}
}
{- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2022-05-21 06:20:18",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}
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. + |
{- "total": 76,
- "page": 1,
- "pages": 8,
- "links": {
- "self": "{endpoint_path}?page=1&per-page=10",
- "next": "{endpoint_path}?page=2&per-page=10",
- "last": "{endpoint_path}?page=8&per-page=10"
}, - "results": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2022-05-21 06:20:18",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}
]
}
{- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2022-05-21 06:20:18",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}
id required | integer The id of post + |
The post
+required | object (Post) |
{- "data": {
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false
}, - "topics": [
- {
- "name": "News"
}
]
}
}
}
{- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "content": {
- "metadata": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "object_model": "humhub\\modules\\post\\models\\Post",
- "object_id": 12,
- "visibility": 1,
- "archived": true,
- "pinned": false,
- "locked_comments": false,
- "created_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "created_at": "2022-04-13 05:15:43",
- "updated_by": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "updated_at": "2022-05-21 06:20:18",
- "contentcontainer_id": 5,
- "stream_channel": "default"
}, - "comments": {
- "total": 55,
- "latestComments": [
- {
- "id": 14,
- "message": "Calvin Klein – Between love and madness lies obsession.",
- "objectModel": "humhub\\modules\\post\\models\\Post",
- "objectId": 123,
- "createdBy": {
- "id": 14,
- "guid": "cd081891-d2e2-40d5-84a4-b47309e71c80",
- "display_name": "John Doe",
}, - "createdAt": "2018-08-09 14:22:03",
- "commentsCount": 5,
- "comments": [
- { }
]
}
]
}, - "likes": {
- "total": 35
}, - "files": {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}, - "topics": [
- {
- "id": 135,
- "name": "News"
}
]
}
}
id required | integer The id of the Post + |
hiddenInStream | Array of any Names of the attached files which should be hidden in stream + |
files required | Array of file The files to upload. + |
{- "files": [
- {
- "id": 14,
- "guid": "bded6dc7-e6f4-417e-a638-b653525529ca",
- "mime_type": "text/plain",
- "size": 14353,
- "file_name": "image.jpg",
}
]
}
Download OpenAPI specification:Download
Welcome to the HumHub topic module API reference.
-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. - |
{- "total": 76,
- "page": 1,
- "results": [
- {
- "id": 1,
- "name": "Api topic"
}
]
}
id required | integer The id of topic - |
Topic name
-name | string |
{- "name": "Api topic"
}
{- "id": 1,
- "name": "Api topic"
}
containerId required | integer The id of container - |
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. - |
{- "total": 76,
- "page": 1,
- "results": [
- {
- "id": 1,
- "name": "Api topic"
}
]
}
containerId required | integer The id of container - |
Topic info
-name required | string |
{- "name": "Api topic"
}
{- "id": 1,
- "name": "Api topic"
}
Download OpenAPI specification:Download
Welcome to the HumHub topic module API reference.
+containerId required | integer The id of container + |
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. + |
{- "total": 76,
- "page": 1,
- "results": [
- {
- "id": 1,
- "name": "Api topic"
}
]
}