Notifications

The Notifications API has methods for managing notifications.

Get notification

GET /api/notifications/{id}

Get a notification by id.

Sample request

$ curl {WEAVY_SERVER}/api/notifications/1
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"

Parameters

Name Type Required Description
id integer True
trashed boolean False

Responses

Status code 200

application/json

{
  "id": "integer",
  "action": "string",
  "actor_id": "integer",
  "template": "string",
  "args": [
    "string"
  ],
  "text": "string",
  "html": "string",
  "plain": "string",
  "url": "string",
  "user_id": "integer",
  "created_at": "string",
  "is_unread": "boolean"
}

Delete notification

DELETE /api/notifications/{id}

Delete a notification.

Sample request

$ curl -X DELETE {WEAVY_SERVER}/api/notifications/1
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"

Parameters

Name Type Required Description
id integer True Notification id.

Responses

Status code 204

No Content


Mark as read

PUT /api/notifications/{id}/mark

Mark a notification as read.

Sample request

$ curl -X PUT {WEAVY_SERVER}/api/notifications/1/mark
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"

Parameters

Name Type Required Description
id integer True Notification id.

Responses

Status code 200

application/json

{
  "id": "integer",
  "action": "string",
  "actor_id": "integer",
  "template": "string",
  "args": [
    "string"
  ],
  "text": "string",
  "html": "string",
  "plain": "string",
  "url": "string",
  "user_id": "integer",
  "created_at": "string",
  "is_unread": "boolean"
}
Status code 404

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}

Mark as unread

DELETE /api/notifications/{id}/mark

Mark a notification as unread.

Sample request

$ curl -X DELETE {WEAVY_SERVER}/api/notifications/1/mark
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"

Parameters

Name Type Required Description
id integer True Notification id.

Responses

Status code 200

application/json

{
  "id": "integer",
  "action": "string",
  "actor_id": "integer",
  "template": "string",
  "args": [
    "string"
  ],
  "text": "string",
  "html": "string",
  "plain": "string",
  "url": "string",
  "user_id": "integer",
  "created_at": "string",
  "is_unread": "boolean"
}
Status code 404

application/json

{
  "type": "string",
  "title": "string",
  "status": "integer",
  "detail": "string",
  "instance": "string"
}

Mark (all) as read

PUT /api/notifications/mark

Mark (all) notifications as read.

Sample request

$ curl -X PUT {WEAVY_SERVER}/api/notifications/mark
-H "Authorization: Bearer {ACCESS_TOKEN}"
            
$ curl -X PUT {WEAVY_SERVER}/api/notifications/mark?id=3
-H "Authorization: Bearer {ACCESS_TOKEN}"

Parameters

Name Type Required Description
id integer False Optional id of last seen notification. When specified, this and previous notifications are marked as read, otherwise all notifications (uncluding yet unseen) are marked as read.

Responses

Status code 200

Success


List notifications

GET /api/notifications

List notifications.

Sample request

$ curl {WEAVY_SERVER}/api/notifications?top=10&unread=true
-H "Authorization: Bearer {ACCESS_TOKEN | WEAVY_APIKEY}"

Parameters

Name Type Required Description
action string False
unread boolean False
q string False
tag string False
trashed boolean False
order_by string False
top integer False
skip integer False
count boolean False
count_only boolean False

Responses

Status code 200

application/json

{
  "data": [
    "object"
  ],
  "start": "integer",
  "end": "integer",
  "count": "integer"
}

Weavy Docs