Skip to content

Latest commit

 

History

History
84 lines (54 loc) · 4.1 KB

README.md

File metadata and controls

84 lines (54 loc) · 4.1 KB

Notifications

(notifications)

Available Operations

getNotifications

Get the notifications that belong to the current user

Example Usage

import { SDK } from "@lukehagar/discoursejs";

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 "@lukehagar/discoursejs";

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 /