Notifications Endpoints¶
Notifications API endpoints.
Overview¶
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/v1/notifications/ |
List Notifications |
| POST | /api/v1/notifications/read-all |
Mark All Notifications Read |
| GET | /api/v1/notifications/unread-count |
Get Unread Notification Count |
| POST | /api/v1/notifications/{notification_id}/read |
Mark Notification Read |
API Reference¶
Sartiq Backend Server - Notifications 0.1.0¶
notifications¶
GET /api/v1/notifications/¶
List Notifications
Description
List the current user's notifications for an org (newest first).
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
limit |
query | integer | 50 | No | |
organization_id |
query | No | |||
skip |
query | integer | 0 | No | |
unread_only |
query | boolean | False | No |
Responses
{
"data": [
{
"id": "691f1bdf-903e-4d28-82ec-cbc98a29fd1c",
"organization_id": "e527237a-cbdb-49cf-9006-80b480cc3971",
"type": "picture_rejected",
"title": "string",
"body": "string",
"deep_link": "string",
"entity_type": "string",
"entity_id": "03482912-47d4-4309-9891-8d63b0e0bffb",
"group_key": null,
"read_at": null,
"created_at": "2022-04-13T15:42:05.901Z"
}
],
"count": 0
}
Schema of the response body
{
"properties": {
"data": {
"items": {
"$ref": "#/components/schemas/NotificationPublic"
},
"type": "array",
"title": "Data"
},
"count": {
"type": "integer",
"title": "Count"
}
},
"type": "object",
"required": [
"data",
"count"
],
"title": "NotificationsPublic",
"description": "Paginated list of notifications for the current user + org."
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
GET /api/v1/notifications/unread-count¶
Get Unread Notification Count
Description
Unread badge count for the current user + org (the bell polls this).
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
organization_id |
query | No |
Responses
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
POST /api/v1/notifications/{notification_id}/read¶
Mark Notification Read
Description
Mark a single notification read (must belong to the current user).
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
notification_id |
path | string | No |
Responses
{
"id": "57a3bda6-66e4-4be9-86f8-42b2583bf33b",
"organization_id": "3ec505d4-1985-469f-819c-7073a0e60572",
"type": "picture_rejected",
"title": "string",
"body": "string",
"deep_link": "string",
"entity_type": "string",
"entity_id": "7ce738b7-9a38-4410-a352-61f641bb85b9",
"group_key": null,
"read_at": null,
"created_at": "2022-04-13T15:42:05.901Z"
}
Schema of the response body
{
"properties": {
"id": {
"type": "string",
"format": "uuid",
"title": "Id"
},
"organization_id": {
"type": "string",
"format": "uuid",
"title": "Organization Id"
},
"type": {
"$ref": "#/components/schemas/NotificationType"
},
"title": {
"type": "string",
"title": "Title"
},
"body": {
"type": "string",
"title": "Body"
},
"deep_link": {
"type": "string",
"title": "Deep Link"
},
"entity_type": {
"type": "string",
"title": "Entity Type"
},
"entity_id": {
"type": "string",
"format": "uuid",
"title": "Entity Id"
},
"group_key": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Group Key"
},
"read_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Read At"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
}
},
"type": "object",
"required": [
"id",
"organization_id",
"type",
"title",
"body",
"deep_link",
"entity_type",
"entity_id",
"created_at"
],
"title": "NotificationPublic",
"description": "A single notification as returned to its recipient."
}
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
POST /api/v1/notifications/read-all¶
Mark All Notifications Read
Description
Mark all of the current user's notifications in an org read.
Input parameters
| Parameter | In | Type | Default | Nullable | Description |
|---|---|---|---|---|---|
OAuth2PasswordBearer |
header | string | N/A | No | |
organization_id |
query | No |
Responses
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
⚠️ This example has been generated automatically from the schema and it is not accurate. Refer to the schema for more information.
Schemas¶
HTTPValidationError¶
| Name | Type | Description |
|---|---|---|
detail |
Array<ValidationError> |
NotificationPublic¶
| Name | Type | Description |
|---|---|---|
body |
string | |
created_at |
string(date-time) | |
deep_link |
string | |
entity_id |
string(uuid) | |
entity_type |
string | |
group_key |
||
id |
string(uuid) | |
organization_id |
string(uuid) | |
read_at |
||
title |
string | |
type |
NotificationType |
NotificationReadAllPublic¶
| Name | Type | Description |
|---|---|---|
updated |
integer |
NotificationsPublic¶
| Name | Type | Description |
|---|---|---|
count |
integer | |
data |
Array<NotificationPublic> |
NotificationType¶
Type: string
NotificationUnreadCount¶
| Name | Type | Description |
|---|---|---|
count |
integer |
ValidationError¶
| Name | Type | Description |
|---|---|---|
ctx |
||
input |
||
loc |
Array<> | |
msg |
string | |
type |
string |
Security schemes¶
| Name | Type | Scheme | Description |
|---|---|---|---|
| OAuth2PasswordBearer | oauth2 |