Class WebhookService
Class representing a set of webhook-related functionality.
Inherited Members
Namespace: EasyPost.Services
Assembly: EasyPost.dll
Syntax
public class WebhookService : EasyPostService, IEasyPostService
  Methods
| Improve this Doc View SourceAll(All, CancellationToken)
List all Webhooks. Related API documentation.
Declaration
public async Task<List<Webhook>> All(All parameters, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| All | parameters | Parameters to filter the list of Webhooks returned.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<List<Webhook>> | A list of Webhook instances.  | 
      
All(Nullable<Dictionary<String, Object>>, CancellationToken)
List all Webhooks. Related API documentation.
Declaration
public async Task<List<Webhook>> All(Dictionary<string, object>? parameters = null, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Nullable<Dictionary<System.String, System.Object>> | parameters | Parameters to filter the list of Webhooks returned.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<List<Webhook>> | A list of Webhook instances.  | 
      
Create(Dictionary<String, Object>, CancellationToken)
Create a Webhook. Related API documentation.
Declaration
public async Task<Webhook> Create(Dictionary<string, object> parameters, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Dictionary<System.String, System.Object> | parameters | Data to use to create the Webhook.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<Webhook> | A Webhook objects.  | 
      
Create(Create, CancellationToken)
Create a Webhook. Related API documentation.
Declaration
public async Task<Webhook> Create(Create parameters, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| Create | parameters | Data to use to create the Webhook.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<Webhook> | A Webhook objects.  | 
      
Delete(String, CancellationToken)
Delete a Webhook. Related API documentation.
Declaration
public async Task Delete(string id, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | id | The ID of the Webhook to delete.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task | None.  | 
      
Retrieve(String, CancellationToken)
Retrieve a Webhook. Related API documentation.
Declaration
public async Task<Webhook> Retrieve(string id, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | id | The ID of the Webhook to retrieve.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<Webhook> | The Webhook.  | 
      
Update(String, Update, CancellationToken)
Enable a disabled Webhook or alter its secret. Related API documentation.
Declaration
public async Task<Webhook> Update(string id, Update parameters = null, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | id | The ID of the Webhook to update.  | 
      
| Update | parameters | Optional data to update Webhook with.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<Webhook> | The updated Webhook.  | 
      
Update(String, Nullable<Dictionary<String, Object>>, CancellationToken)
Enable a disabled Webhook or alter its secret. Related API documentation.
Declaration
public async Task<Webhook> Update(string id, Dictionary<string, object>? parameters = null, CancellationToken cancellationToken = null)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.String | id | The ID of the Webhook to update.  | 
      
| System.Nullable<Dictionary<System.String, System.Object>> | parameters | Data to update Webhook with.  | 
      
| CancellationToken | cancellationToken | 
Returns
| Type | Description | 
|---|---|
| Task<Webhook> | The updated Webhook.  | 
      
ValidateWebhook(Byte[], Dictionary<String, Nullable<Object>>, String)
Validate a received webhook's HMAC signature. Related API documentation.
Declaration
public Event ValidateWebhook(byte[] data, Dictionary<string, object?> headers, string secret)
  Parameters
| Type | Name | Description | 
|---|---|---|
| System.Byte[] | data | Byte data of the received webhook request.  | 
      
| Dictionary<System.String, System.Nullable<System.Object>> | headers | Dictionary of headers from the received webhook request.  | 
      
| System.String | secret | Secret used to sign webhooks.  | 
      
Returns
| Type | Description | 
|---|---|
| Event | An Event instance if webhook is valid.  | 
      
Exceptions
| Type | Condition | 
|---|---|
| SignatureVerificationError | If webhook has an invalid signature.  |