Class Webhook
Webhook definitions. Webhooks broadcast events from NetServer to remote servers.
Carrier object for Webhook. Services for the Webhook Carrier is available from the IWebhookAgent.Namespace: SuperOffice.CRM.Services
Assembly: SuperOffice.Services.dll
Syntax
public class Webhook : Object
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}
Constructors
Webhook()
Default constructor
Declaration
public Webhook()
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}
See Also
Properties
ErrorsEmail
Email address to send error message to when this webhook state changes to too-many errors.
Declaration
public virtual string ErrorsEmail { get; set; }
Property Value
Type | Description |
---|---|
String |
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}
See Also
Events
Array of event names that trigger this webhook: ['contact.created', 'sale.changed']
Declaration
public virtual string[] Events { get; set; }
Property Value
Type | Description |
---|---|
String[] |
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}
See Also
Headers
Custom HTTP Headers to add to webhook requests.
Declaration
public virtual StringDictionary Headers { get; set; }
Property Value
Type | Description |
---|---|
StringDictionary |
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}
See Also
Name
Name to identify this webhook. Does not have to be unique.
Declaration
public virtual string Name { get; set; }
Property Value
Type | Description |
---|---|
String |
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}
See Also
Properties
Custom values to inject into JSON body of webhook call.
Declaration
public virtual StringObjectDictionary Properties { get; set; }
Property Value
Type | Description |
---|---|
StringObjectDictionary |
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}
See Also
Registered
Registered when in UTC.
Declaration
public virtual DateTime Registered { get; set; }
Property Value
Type | Description |
---|---|
DateTime |
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}
See Also
RegisteredAssociate
The user that created the webhook.
Declaration
public virtual Associate RegisteredAssociate { get; set; }
Property Value
Type | Description |
---|---|
Associate |
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}
See Also
Secret
Shared secret key used for generating SHA256 HMAC signature, so that receiver can verify that call came from this server
Declaration
public virtual string Secret { get; set; }
Property Value
Type | Description |
---|---|
String |
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}
See Also
State
Webhook status - should we post events to the URL? 1=Active, 2=Stopped or 3=TooManyErrors
Declaration
public virtual WebhookState State { get; set; }
Property Value
Type | Description |
---|---|
WebhookState |
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}
See Also
TargetUrl
Destination to POST event info to. URL for webhooks. Id for CRM scripts
Declaration
public virtual string TargetUrl { get; set; }
Property Value
Type | Description |
---|---|
String |
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}
See Also
Type
Name of plugin that handles this webhook. 'webhook' for HTTP POST notifications, 'crmscript' for script invocations.
Declaration
public virtual string Type { get; set; }
Property Value
Type | Description |
---|---|
String |
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}
See Also
Updated
Last updated when in UTC.
Declaration
public virtual DateTime Updated { get; set; }
Property Value
Type | Description |
---|---|
DateTime |
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}
See Also
UpdatedAssociate
The user that last updated the webhook.
Declaration
public virtual Associate UpdatedAssociate { get; set; }
Property Value
Type | Description |
---|---|
Associate |
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}
See Also
WebhookId
Primary Key. Unique id for this webhook.
Declaration
public virtual int WebhookId { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}
See Also
Methods
ToString()
Returns the carrier contents as a formatted string.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | The carrier contents. |
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}
See Also
ToString(String)
Returns the carrier contents as a formatted string, useful for debugging. Each line in the output is prefixed with the input value.
Declaration
public string ToString(string prefix)
Parameters
Type | Name | Description |
---|---|---|
String | prefix | The line prefix (typically used for indenting) |
Returns
Type | Description |
---|---|
String | The carrier contents. |
Examples
Get Webhook 123 using the agent:
using SuperOffice;
using SuperOffice.CRM.Services;
using (SoSession mySession = SoSession.Authenticate("user", "pass"))
{
var agent = new WebhookAgent();
var webhook = agent.GetWebhook( 123 );
}