Skip to content

Latest commit

 

History

History
85 lines (59 loc) · 7.08 KB

README.md

File metadata and controls

85 lines (59 loc) · 7.08 KB

Webhooks

(integrations.webhooks)

Overview

Available Operations

  • retrieve - Get webhook support status for provider

retrieve

Return the status of the webhook for this provider, if it is supported or if it is not based on a boolean value

Example Usage

import { Novu } from "@novu/api";

const novu = new Novu({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await novu.integrations.webhooks.retrieve("<id>");

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { NovuCore } from "@novu/api/core.js";
import { integrationsWebhooksRetrieve } from "@novu/api/funcs/integrationsWebhooksRetrieve.js";

// Use `NovuCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const novu = new NovuCore({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await integrationsWebhooksRetrieve(novu, "<id>");

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
providerOrIntegrationId string ✔️ N/A
idempotencyKey string A header for idempotency purposes
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.IntegrationsControllerGetWebhookSupportStatusResponse>

Errors

Error Type Status Code Content Type
errors.ErrorDto 400, 401, 403, 404, 405, 409, 413, 415 application/json
errors.ErrorDto 414 application/json
errors.ValidationErrorDto 422 application/json
errors.ErrorDto 500 application/json
errors.SDKError 4XX, 5XX */*