API v2: Notification Filterยถ


Data Structuresยถ

NotificationFilterModelยถ

Attribute

Type

Required

Description

id

string

Unique and read-only object Identifier

user_id

string

yes

Immutable. Uniqueness is required in the combination of attribute user_id with attributes event_name, event_transport and safe_id. Requires read right on object type user for GET, POST, and DELETE requests.

safe_id

string

yes

Immutable. Uniqueness is required in the combination of attribute safe_id with attributes event_name, event_transport and user_id. Requires read right on object type safe for GET, POST, and DELETE requests.

event_name

string {safe_add_server, safe_add_user, safe_blocked, safe_create, safe_remove, safe_unblocked, server_blocked, server_create, server_remove, server_unblocked, user_blocked, user_create, user_remove, user_unblocked, session_finish, session_ml, session_regexp, session_start, session_waiting, session_inject_close, session_inject_open, disk_failure, filesystem_full, access_request_pending, access_request_accepted, access_request_rejected}

yes

Case-insensitive. Immutable. Uniqueness is required in the combination of attribute event_name with attributes event_transport, safe_id and user_id.

event_transport

string {mail, push, slack}

yes

Case-insensitive. Uniqueness is required in the combination of attribute event_transport with attributes event_name, safe_id and user_id.

created_at

datetime

Read-only. Timestamp of creation.

modified_at

datetime

Read-only. Timestamp of modification.

removed

boolean

Read-only

Retrieve Available Attributes of the NotificationFilterModelยถ

Request

Method

GET

Path

/api/v2/objspec/notification_filter

To check allowed methods, available URL parameters and possible responses please refer to the API Overview section.


Get Notifications Listยถ

Request

Method

GET

Path

/api/v2/notification_filter

Example Request

GET /api/v2/notification_filter`

curl -s -k -X GET \
  -H 'Authorization: sgfeea6jsaz4mum9su8w6' \
  'https://10.0.214.98/api/v2/notification_filter'

Response

{
    "result": "success",
    "notification_filter": {
        "id": "9124292845052624897",
        "user_id": "9124292845052624898",
        "safe_id": "9124292845052624898",
        "event_name": "access_request_accepted",
        "event_transport": "mail",
        "created_at": "2024-06-11 22:21:15.750371-07",
        "modified_at": "2024-06-11 22:21:15.750371-07"
    }
}

Get Notification Filter by IDยถ

Request

Method

GET

Path

/api/v2/notification_filter/<id>

Example Request

GET /api/v2/notification_filter/<id>`

curl -s -k -X GET \
  -H 'Authorization: sgfeea6jsaz4mum9su8w6' \
  'https://10.0.214.98/api/v2/notification_filter/9124292845052624897'

Response

{
    "result": "success",
    "notification_filter": {
        "id": "9124292845052624897",
        "user_id": "9124292845052624898",
        "safe_id": "9124292845052624898",
        "event_name": "access_request_accepted",
        "event_transport": "mail",
        "created_at": "2024-06-11 22:21:15.750371-07",
        "modified_at": "2024-06-11 22:21:15.750371-07"
    }
}

Create Notification Filterยถ

Request

Method

POST

Path

/api/v2/notification_filter

Headers

Content-Type: Application/json

Body

NotificationFilterModel

Example Request

POST /api/v2/notification_filter`

curl -s -k -X POST \
  -H 'Authorization: sgfeea6jsaz4mum9su8w6' \
  -H 'Content-Type: application/json' \
  'https://10.0.214.98/api/v2/notification_filter' \
  -d'{"safe_id":"9124292845052624898","user_id":"9124292845052624903","event_name":"safe_add_server","event_transport":"mail"}'

Response

{
    "result": "success",
    "notification_filter": {
        "id": "9124292845052624914"
    }
}

Deleting Notification Filterยถ

Request

Method

DELETE

Path

/api/v2/notification_filter/<id>

Example Request

DELETE /api/v2/notification_filter/<id>`

curl -s -k -X DELETE \
  -H 'Authorization: sgfeea6jsaz4mum9su8w6' \
  'https://10.0.214.98/api/v2/notification_filter/9124292845052624897'

Response

{
    "result": "success"
}