This page covers configuration and management of Webhook Events objects.

Object Overview

Webhook events are invocations of a webhook rule to a given webhook target.

Endpoint, URL, and Supported Methods

Objects are managed via the Configuration server API at [http|https]://[hostname]:[port]/v1.0/tenants/[tenant-guid]/webhookevents

Supported methods include: GET HEAD

Structure

Objects have the following structure:

{
  "GUID": "8f6e4a3c-1234-4fd9-bcfa-987654321000",
  "TenantGUID": "00000000-0000-0000-0000-000000000000",
  "TargetGUID": "00000000-0000-0000-0000-000000000001",
  "RuleGUID": "00000000-0000-0000-0000-000000000002",
  "EventType": "DocumentUploaded",
  "ContentLength": 2048,
  "TimeoutMs": 5000,
  "Url": "https://webhook.receiver.com/event",
  "ContentType": "application/json",
  "ExpectStatus": 200,
  "RetryIntervalMs": 10000,
  "Attempt": 1,
  "MaxAttempts": 5,
  "HttpStatus": 200,
  "CreatedUtc": "2025-03-29T12:00:00.000Z",
  "AddedUtc": "2025-03-29T12:00:10.000Z",
  "LastAttemptUtc": "2025-03-29T12:01:00.000Z",
  "NextAttemptUtc": "2025-03-29T12:05:00.000Z",
  "LastFailureUtc": "2025-03-29T12:01:00.000Z",
  "SuccessUtc": null,
  "FailedUtc": null
}
  • GUID GUID globally unique identifier for the object
  • TenantGUID GUID globally unique identifier for the tenant
  • TargetGUID GUID globally unique identifier for the target
  • RuleGUID GUID globally unique identifier for the rule
  • EventType string event type
  • ContentLength number Content length
  • MaxAttempts number number of max attempts for webhook
  • RetryIntervalMs number inter between attempts in ms
  • TimeoutMs number time out in ms
  • CreatedUtc datetime timestamp from creation, in UTC time

Enumerate

Enumerate objects by using GET /v2.0/tenants/[tenant-guid]/encryptionkeys

curl --location 'http://view.homedns.org:8000/v2.0/tenants/00000000-0000-0000-0000-000000000000/webhookevents/' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "default", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
);


const enumerateWebhookEvents = async () => {
  try {
    const response = await api.enumerateWebhookEvents();
    console.log(response, "Webhook events fetched successfully");
  } catch (err) {
    console.log("Error fetching Webhook events:", err);
  }
};

enumerateWebhookEvents();

Read

To read an object by GUID, call GET /v1.0/tenants/[tenant-guid]/encryptionkeys/[encryptionkey-guid]. If the object exists, it will be returned as a JSON object in the response body. If it does not exist, a 404 will be returned with a NotFound error response.

curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhookevents/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "default", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
);
const readWebhookEvent = async () => {
  try {
    const response = await api.retrieveWebhookEvent(
      "00000000-0000-0000-0000-000000000000"
    );
    console.log(response, "Webhook events fetched successfully");
  } catch (err) {
    console.log("Error fetching Webhook events:", err);
  }
};

readWebhookEvent();

Read all

o read all objects, call GET /v1.0/tenants/[tenant-guid]/encryptionkeys/. If the object exists, it will be returned as an array of JSON object in the response body

curl --location 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhookevents/' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "default", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
);

const readWebhookEvents = async () => {
  try {
    const response = await api.retrieveWebhookEvents();
    console.log(response, "Webhook events fetched successfully");
  } catch (err) {
    console.log("Error fetching Webhook events:", err);
  }
};

readWebhookEvents();

Check Existence

Note: the HEAD method can be used as an alternative to get to simply check the existence of the object. HEAD requests return either a 200/OK in the event the object exists, or a 404/Not Found if not. No response body is returned with a HEAD request.

curl --location --head 'http://view.homedns.org:8000/v1.0/tenants/00000000-0000-0000-0000-000000000000/webhookevents/00000000-0000-0000-0000-000000000000' \
--header 'Authorization: ••••••'
import { ViewConfigurationSdk } from "view-sdk";

const api = new ViewConfigurationSdk(
  "default", //tenant Id
  "default", //access token
  "http://localhost:8000/" //endpoint
);

const existWebhookEvent = async () => {
  try {
    const response = await api.existsWebhookEvent(
      "b4cf5430-9c25-4514-b3e5-fe7fd1108edb"
    );
    console.log(response, "Webhook event exists");
  } catch (err) {
    console.log("Error checking Webhook event:", err);
  }
};
existWebhookEvent();