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