mirror of
https://github.com/LukeHagar/discoursejs.git
synced 2025-12-06 04:19:37 +00:00
4.1 KiB
4.1 KiB
Notifications
(notifications)
Available Operations
- getNotifications - Get the notifications that belong to the current user
- markNotificationsAsRead - Mark notifications as read
getNotifications
Get the notifications that belong to the current user
Example Usage
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.notifications.getNotifications();
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Response
Promise<operations.GetNotificationsResponse>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |
markNotificationsAsRead
Mark notifications as read
Example Usage
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.notifications.markNotificationsAsRead({});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request |
operations.MarkNotificationsAsReadRequestBody | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Response
Promise<operations.MarkNotificationsAsReadResponse>
Errors
| Error Object | Status Code | Content Type |
|---|---|---|
| errors.SDKError | 4xx-5xx | / |