Table of Contents

Class WebhookUtility

Namespace
BoldSign.Model.Webhook
Assembly
BoldSign.Api.dll

The webhook event utility.

public static class WebhookUtility
Inheritance
WebhookUtility
Inherited Members

Fields

BoldSignEventHeader

The BoldSign event header.

public const string BoldSignEventHeader = "X-BoldSign-Event"

Field Value

string

BoldSignSignatureHeader

The BoldSign signature header.

public const string BoldSignSignatureHeader = "X-BoldSign-Signature"

Field Value

string

Methods

ParseEvent(string)

Parses a JSON string from a BoldSign webhook into a WebhookEvent object.

public static WebhookEvent ParseEvent(string json)

Parameters

json string

The JSON string to parse.

Returns

WebhookEvent

The deserialized WebhookEvent.

ValidateSignature(string, string, string, long)

Comparing the hmac signature by request header.

public static void ValidateSignature(string json, string signatureHeader, string secretKey, long tolerance = 300)

Parameters

json string

The json payload from the webhook request.

signatureHeader string

The signature header (Key name: BoldSignSignatureHeader) from the webhook request.

secretKey string

The webhook secret key.

tolerance long

The timestamp tolerance (defaults to 300 seconds).

Exceptions

ArgumentNullException

Thrown when one of the required input is null or empty.

BoldSignSignatureException

Thrown when there is mismatch in signature comparison.