Skip to content

Latest commit

 

History

History
107 lines (81 loc) · 6.74 KB

README.md

File metadata and controls

107 lines (81 loc) · 6.74 KB

EventLogs

(webhook.eventLogs)

Overview

Available Operations

  • list - List event logs

list

List event logs

Example Usage

import { Apideck } from "@apideck/unify";

const apideck = new Apideck({
  apiKey: process.env["APIDECK_API_KEY"] ?? "",
  consumerId: "test-consumer",
  appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});

async function run() {
  const result = await apideck.webhook.eventLogs.list({
    filter: {
      excludeApis: "vault,proxy",
      consumerId: "test_user_id",
      entityType: "Connection",
      eventType: "vault.connection.callable",
    },
  });

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Standalone function

The standalone function version of this method:

import { ApideckCore } from "@apideck/unify/core.js";
import { webhookEventLogsList } from "@apideck/unify/funcs/webhookEventLogsList.js";

// Use `ApideckCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const apideck = new ApideckCore({
  apiKey: process.env["APIDECK_API_KEY"] ?? "",
  consumerId: "test-consumer",
  appId: "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
});

async function run() {
  const res = await webhookEventLogsList(apideck, {
    filter: {
      excludeApis: "vault,proxy",
      consumerId: "test_user_id",
      entityType: "Connection",
      eventType: "vault.connection.callable",
    },
  });

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

  const { value: result } = res;

  for await (const page of result) {
    // Handle the page
    console.log(page);
  }
}

run();

Parameters

Parameter Type Required Description
request operations.WebhookEventLogsAllRequest ✔️ The request object to use for the request.
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.WebhookEventLogsAllResponse>

Errors

Error Type Status Code Content Type
errors.BadRequestResponse 400 application/json
errors.UnauthorizedResponse 401 application/json
errors.PaymentRequiredResponse 402 application/json
errors.NotFoundResponse 404 application/json
errors.UnprocessableResponse 422 application/json
errors.APIError 4XX, 5XX */*