HumHub - Notification API (1.0.0)

Download OpenAPI specification:

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
integer >= 0

The number of page of the result set.

limit
integer [ 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": [
    ]
}

Send a custom notification to a user

Send a free text notification with target URL to a specific user.

Request Body schema: application/json
required
userId
required
integer

Target user ID.

text
required
string

Notification text shown to the user.

url
required
string

Target URL Absolute or Relative to HumHub base URL.

Responses

Request samples

Content type
application/json
{}

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Notification successfully sent"
}

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
integer >= 0

The number of page of the result set.

limit
integer [ 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"
}