Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NotificationsAPI

api

public NotificationsAPI - Provides methods to interact with the Notifications API

Hierarchy

Index

Constructors

constructor

Properties

Protected _api

Protected _endpoint

_endpoint: string

Protected _headers

_headers: object

Protected _okuna

_okuna: Client

Defines an API request.

param

Protected _params

_params: RequestParams

Protected _paths

_paths: string[] = []

Protected _url

_url: string

requiresToken

requiresToken: boolean = true

Methods

_constructFormdata

  • _constructFormdata(opts?: object | null): FormData
  • constructFormdata() Constructs a FormData instance from an object.

    Parameters

    • Default value opts: object | null = null

      the object to generate the FormData from

    Returns FormData

Protected delete

  • delete(): Promise<any>

deleteNotification

  • deleteNotification(id: number): Promise<any>
  • DELETE /api/notifications/:id/ - promises to delete a notification

    Parameters

    • id: number

      The ID of the notification

    Returns Promise<any>

deleteNotifications

  • deleteNotifications(): Promise<any>
  • DELETE /api/notifications/ - promises to delete all notifications

    Returns Promise<any>

generateHeaders

  • generateHeaders(contentType?: string | null): object
  • generateHeaders() A function used to generate the headers that need to be passed to the request performee.

    Parameters

    • Default value contentType: string | null = null

    Returns object

Protected get

  • get(): Promise<any>

getNotification

  • getNotification(id: number): Promise<any>
  • GET /api/notifications/:id/ - promises to get a notification

    Parameters

    • id: number

      The ID of the notification

    Returns Promise<any>

getNotifications

getUnreadNotificationsCount

  • GET /api/notifications/unread/count - promises to get the count of the user's unread notifications

    Parameters

    Returns Promise<any>

Protected patch

  • patch(body: object): Promise<any>

Protected patchFormdata

  • patchFormdata(body: object): Promise<any>

Protected post

  • post(body: object): Promise<any>

Protected postFormdata

  • postFormdata(body: object): Promise<any>

Protected put

  • put(body: object): Promise<any>

Protected putFormdata

  • putFormdata(body: object): Promise<any>

readNotification

  • readNotification(id: number): Promise<any>
  • POST /api/notifications/:id/ - promises to mark a notification as read

    Parameters

    • id: number

      The ID of the notification

    Returns Promise<any>

readNotifications

Generated using TypeDoc