Class Webhook
Describes a webhook for the ISystemWebhookPlugin.
Inherited Members
Namespace: SuperOffice.CRM.Webhooks
Assembly: SoDataBase.dll
Syntax
public class Webhook
Constructors
Webhook(int, string, string, string, string)
Describes a webhook for the ISystemWebhookPlugin.
Declaration
public Webhook(int id, string name, string url, string eventName, string secret)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | |
| string | name | |
| string | url | |
| string | eventName | |
| string | secret |
Webhook(int, string, string, string[], string)
Describes a webhook for the ISystemWebhookPlugin.
Declaration
public Webhook(int id, string name, string url, string[] eventNames, string secret)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | |
| string | name | |
| string | url | |
| string[] | eventNames | |
| string | secret |
Fields
Events
Events that this hook is subscribed to. "sale.created", "project.updated", "contact.deleted" etc
Declaration
public string[] Events
Field Value
| Type | Description |
|---|---|
| string[] |
Name
Name of this hook. e.g. "My ERP Integration"
Declaration
public string Name
Field Value
| Type | Description |
|---|---|
| string |
TargetUrl
URL to POST events to, or otherwise identify the recipient of the webhook call (i.e. script id).
Declaration
public string TargetUrl
Field Value
| Type | Description |
|---|---|
| string |
Type
Name of webhook plugin that handles dispatching this webhook: "webhook", "crmscript" etc.
Declaration
public string Type
Field Value
| Type | Description |
|---|---|
| string |
WebhookId
Unique identifier for this webhook.
Declaration
public int WebhookId
Field Value
| Type | Description |
|---|---|
| int |
Properties
ApplicationToken
Application that registered this hook. (Optional)
Declaration
public string ApplicationToken { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Description
Human-readable description of this webhook.
Declaration
public string Description { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
ErrorAssociateIds
Associate IDs to notify when this webhook is disabled.
Declaration
public int[] ErrorAssociateIds { get; set; }
Property Value
| Type | Description |
|---|---|
| int[] |
ErrorEmails
Email addresses to notify when this webhook is disabled.
Declaration
public string[] ErrorEmails { get; set; }
Property Value
| Type | Description |
|---|---|
| string[] |
ErrorsEmail
Where to send error notifications when webhook gets disabled. Maps to ErrorEmails[0] for backward compatibility.
Declaration
public string ErrorsEmail { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Headers
Hook-specific custom headers to be added to the webhook payload.
Declaration
public Dictionary<string, string> Headers { get; set; }
Property Value
| Type | Description |
|---|---|
| Dictionary<string, string> |
NotifyVia
How to notify recipients when this webhook changes state. 1=Email, 2=InApp.
Declaration
public WebhookNotifyVia NotifyVia { get; set; }
Property Value
| Type | Description |
|---|---|
| WebhookNotifyVia |
NotifyWhen
When to notify recipients. Bitflag: 1=FirstFailure, 2=Disabling.
Declaration
public WebhookNotifyWhen NotifyWhen { get; set; }
Property Value
| Type | Description |
|---|---|
| WebhookNotifyWhen |
Properties
Hook-specific data properties to be added to the webhook payload.
Declaration
public Dictionary<string, object> Properties { get; set; }
Property Value
| Type | Description |
|---|---|
| Dictionary<string, object> |
Registered
Describes a webhook for the ISystemWebhookPlugin.
Declaration
public DateTime Registered { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime |
RegisteredAssociateId
Describes a webhook for the ISystemWebhookPlugin.
Declaration
public int RegisteredAssociateId { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
Secret
Shared secret. Used for creating a SHA256 HMAC if set.
Declaration
public string Secret { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
State
Webhook can be Active, Stopped or Errored.
Declaration
public WebhookState State { get; set; }
Property Value
| Type | Description |
|---|---|
| WebhookState |
Updated
Describes a webhook for the ISystemWebhookPlugin.
Declaration
public DateTime Updated { get; set; }
Property Value
| Type | Description |
|---|---|
| DateTime |
UpdatedAssociateId
Describes a webhook for the ISystemWebhookPlugin.
Declaration
public int UpdatedAssociateId { get; set; }
Property Value
| Type | Description |
|---|---|
| int |