Webhook Events

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]/webhookevents/

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(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
);


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

enumerateWebhookEvents();
import view_sdk
from view_sdk import configuration

sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")

def enumerateWebhookEvents():
    webhookEvents = configuration.WebhookEvent.enumerate()
    print(webhookEvents)

enumerateWebhookEvents()

Read

To read an object by GUID, call GET /v1.0/tenants/[tenant-guid]/webhookevents/[webhookevent-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(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
);
const readWebhookEvent = async () => {
  try {
    const response = await api.WebhookEvent.read(
      "<webhookevent-guid>"
    );
    console.log(response, "Webhook events fetched successfully");
  } catch (err) {
    console.log("Error fetching Webhook events:", err);
  }
};

readWebhookEvent();
import view_sdk
from view_sdk import configuration

sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")

def readWebhookEvent():
    webhookEvent = configuration.WebhookEvent.retrieve("<webhookevent-guid>")
    print(webhookEvent)

readWebhookEvent()
using View.Sdk;
using View.Sdk.Configuration;

ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
            
WebhookEvent webhookEvent = await sdk.RetrieveWebhookEvent(Guid.Parse("<webhookevent-guid>"));

Read all

o read all objects, call GET /v1.0/tenants/[tenant-guid]/webhookevents/. 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(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
);

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

readWebhookEvents();
import view_sdk
from view_sdk import configuration

sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")

def readAllWebhookEvents():
    webhookEvents = configuration.WebhookEvent.retrieve_all()
    print(webhookEvents)

readAllWebhookEvents()


using View.Sdk;
using View.Sdk.Configuration;

ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>"),"default", "http://localhost:8000/");
            
List<WebhookEvent> webhookEvents = await sdk.RetrieveWebhookEvents();

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(
  "http://localhost:8000/", //endpoint
  "default", //tenant Id
  "default" //access key
);

const existWebhookEvent = async () => {
  try {
    const response = await api.WebhookEvent.exists(
      "<webhookevent-guid>"
    );
    console.log(response, "Webhook event exists");
  } catch (err) {
    console.log("Error checking Webhook event:", err);
  }
};
existWebhookEvent();
import view_sdk
from view_sdk import configuration

sdk = view_sdk.configure( access_key="default",base_url="localhost", tenant_guid= "<tenant-guid>")

def existsWebhookEvent():
    webhookEvent = configuration.WebhookEvent.exists("<webhookevent-guid>")
    print(webhookEvent)

existsWebhookEvent()
using View.Sdk;
using View.Sdk.Configuration;

ViewConfigurationSdk sdk = new ViewConfigurationSdk(Guid.Parse("<tenant-guid>0"),"default", "http://localhost:8000/");
        
bool exists = await sdk.ExistsWebhookEvent(Guid.Parse("<webhookevent-guid>"));