Options
All
  • Public
  • Public/Protected
  • All
Menu

Class WebhooksClient

Client providing access to Autodesk Platform Services webhooks APIs.

tutorial

webhooks

Hierarchy

Index

Constructors

constructor

  • Initializes new client with specific authentication method.

    Parameters

    • auth: IAuthOptions

      Authentication object, containing either client_id and client_secret properties (for 2-legged authentication), or a single token property (for 2-legged or 3-legged authentication with pre-generated access token).

    • Optional host: string
    • Optional region: US | EMEA

    Returns WebhooksClient

Properties

Protected Optional auth

Protected axios

axios: AxiosInstance

Protected host

host: string

Protected region

region: Region

Protected root

root: string

Protected Optional token

token: string

Methods

Private _collect

  • _collect(endpoint: string): Promise<any>
  • Parameters

    • endpoint: string

    Returns Promise<any>

Private _pager

  • _pager(endpoint: string): AsyncGenerator<any, void, unknown>
  • Parameters

    • endpoint: string

    Returns AsyncGenerator<any, void, unknown>

createHook

Protected delete

  • delete(endpoint: string, headers?: {}, scopes: string[]): Promise<any>
  • Parameters

    • endpoint: string
    • headers: {} = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

deleteHook

  • Deletes a webhook (docs).

    async
    throws

    Error when the request fails, for example, due to insufficient rights, or incorrect scopes.

    Parameters

    • system: WebhookSystem

      Webhook system (e.g., "data").

    • event: WebhookEvent

      Webhook event (e.g., "dm.version.copied").

    • id: string

    Returns Promise<void>

Protected fetch

  • fetch(config: AxiosRequestConfig): Promise<AxiosResponse<any>>

Protected get

  • get(endpoint: string, headers?: {}, scopes: string[]): Promise<any>
  • Parameters

    • endpoint: string
    • headers: {} = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

Protected getBuffer

  • getBuffer(endpoint: string, headers?: {}, scopes: string[]): Promise<any>
  • Parameters

    • endpoint: string
    • headers: {} = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

getHookDetails

  • Provides details about a specific webhook (docs).

    async
    throws

    Error when the request fails, for example, due to insufficient rights, or incorrect scopes.

    Parameters

    • system: WebhookSystem

      Webhook system (e.g., "data").

    • event: WebhookEvent

      Webhook event (e.g., "dm.version.copied").

    • id: string

      Webhook ID.

    Returns Promise<IWebhook>

    Webhook details.

Protected getStream

  • getStream(endpoint: string, headers?: {}, scopes: string[]): Promise<any>
  • Parameters

    • endpoint: string
    • headers: {} = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

iterateHooks

listHooks

Protected patch

  • patch(endpoint: string, data: any, headers?: {}, scopes: string[]): Promise<any>
  • Parameters

    • endpoint: string
    • data: any
    • headers: {} = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

Protected post

  • post(endpoint: string, data: any, headers?: {}, scopes: string[]): Promise<any>
  • Parameters

    • endpoint: string
    • data: any
    • headers: {} = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

Protected put

  • put(endpoint: string, data: any, headers?: {}, scopes: string[]): Promise<any>
  • Parameters

    • endpoint: string
    • data: any
    • headers: {} = {}
      • [name: string]: string
    • scopes: string[]

    Returns Promise<any>

reset

  • reset(auth?: { client_id: string; client_secret: string } | { token: string }, host?: string, region?: US | EMEA): void
  • Resets client to specific authentication method, APS host, and availability region.

    Parameters

    • Optional auth: { client_id: string; client_secret: string } | { token: string }
    • Optional host: string
    • Optional region: US | EMEA

    Returns void

Protected setAuthorization

  • setAuthorization(options: any, scopes: string[]): Promise<void>

updateHook

  • Updates an existing webhook (docs).

    async

    Parameters

    • system: WebhookSystem

      Webhook system (e.g., "data").

    • event: WebhookEvent

      Webhook event (e.g., "dm.version.copied").

    • id: string

      Webhook ID.

    • params: IUpdateWebhookParams

      Parameters to update. Undefined properties are ignored, and "null" values can be used to clear the specific configuration of the webhook.

    Returns Promise<void>

Generated using TypeDoc