Skip to main content

Class Webhook

Namespace: SuperOffice.WebApi.Data
Assembly: SuperOffice.WebApi.dll
Carrier object for Webhook. Webhook definitions. Webhooks broadcast events from NetServer to remote servers.

Inheritance

objectWebhook

Inherited Members

object.ToString(), object.Equals(object), object.Equals(object, object), object.ReferenceEquals(object, object), object.GetHashCode(), object.GetType(), object.MemberwiseClone()

Examples

Get Webhook 123 using the WebApi client:
var configuration = new WebApiConfiguration(url);
var agent = new WebhookAgent(configuration);
var webhook = agent.GetWebhook( 123 );

Constructors

Webhook()

Default constructor - defaults any enum props to 0.

Properties

ConsecutiveErrors

Number of consecutive errors. Reset to 0 when an non-error is received. If too many errors, webhook.state is changed to TooManyErrors(3) to deactivate webhook.

Property Value

int

Description

Human-readable description of what this webhook does.

Property Value

string

ErrorAssociates

Associates to notify when this webhook is disabled.

Property Value

MDOListItem[]

ErrorEmails

Email addresses to notify when this webhook is disabled.

Property Value

string[]

ErrorsEmail

Obsolete, use ErrorEmails instead

Property Value

string

Events

Array of event names that trigger this webhook: [‘contact.created’, ‘sale.changed’]

Property Value

string[]

Headers

Custom HTTP Headers to add to webhook requests.

Property Value

StringDictionary

LastError

Most recent error message received from target. HTTP Headers + body. To help with debugging webhooks.

Property Value

string

Name

Name to identify this webhook. Does not have to be unique.

Property Value

string

NotifyVia

How to notify recipients when this webhook changes state. 1=Email, 2=InApp. NULL if unknown enum value.

Property Value

WebhookNotifyVia?

See Also

Webhook.NotifyVia_String

NotifyVia_String

How to notify recipients when this webhook changes state. 1=Email, 2=InApp. Raw string enum value.

Property Value

string

See Also

Webhook.NotifyVia

NotifyWhen

When to notify recipients. Bitflag: 1=FirstFailure, 2=Disabling. NULL if unknown enum value.

Property Value

WebhookNotifyWhen?

See Also

Webhook.NotifyWhen_String

NotifyWhen_String

When to notify recipients. Bitflag: 1=FirstFailure, 2=Disabling. Raw string enum value.

Property Value

string

See Also

Webhook.NotifyWhen

Properties

Custom values to inject into JSON body of webhook call.

Property Value

StringObjectDictionary

Registered

Registered when

Property Value

DateTime

RegisteredAssociate

The user that created the webhook.

Property Value

Associate

Secret

Shared secret key used for generating SHA256 HMAC signature, so that receiver can verify that call came from this server

Property Value

string

State

Webhook status - should we post events to the URL? 1=Active, 2=Stopped or 3=TooManyErrors NULL if unknown enum value.

Property Value

WebhookState?

See Also

Webhook.State_String

State_String

Webhook status - should we post events to the URL? 1=Active, 2=Stopped or 3=TooManyErrors Raw string enum value.

Property Value

string

See Also

Webhook.State

TargetUrl

Destination to POST event info to. URL for webhooks. Id for CRM scripts

Property Value

string

TotalCalls

Number of times webhook has been invoked since registered. For statistical purposes.

Property Value

int

TotalErrors

Number of times webhook has returned error since registered. For statistical purposes.

Property Value

int

Type

Name of plugin that handles this webhook. ‘webhook’ for HTTP POST notifications, ‘crmscript’ for script invocations.

Property Value

string

Updated

Last updated when

Property Value

DateTime

UpdatedAssociate

The user that last updated the webhook.

Property Value

Associate

WebhookId

Primary Key. Unique id for this webhook.

Property Value

int

See Also

WebhookAgent