Show / Hide Table of Contents

Class WebhookService

Class representing a set of webhook-related functionality.

Inheritance
System.Object
EasyPostService
WebhookService
Implements
IEasyPostService
IDisposable
Inherited Members
EasyPostService.Client
EasyPostService.RequestAsync<T>(Method, String, CancellationToken, Nullable<Dictionary<String, Object>>, Nullable<String>, ApiVersion)
EasyPostService.RequestAsync(Method, String, CancellationToken, Nullable<Dictionary<String, Object>>, ApiVersion)
EasyPostService.Dispose()
EasyPostService.Dispose(Boolean)
Namespace: EasyPost.Services
Assembly: EasyPost.dll
Syntax
public class WebhookService : EasyPostService, IEasyPostService

Methods

| Improve this Doc View Source

All(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

to use for the HTTP request.

Returns
Type Description
Task<List<Webhook>>

A list of Webhook instances.

| Improve this Doc View Source

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

to use for the HTTP request.

Returns
Type Description
Task<List<Webhook>>

A list of Webhook instances.

| Improve this Doc View Source

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

to use for the HTTP request.

Returns
Type Description
Task<Webhook>

A Webhook objects.

| Improve this Doc View Source

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

to use for the HTTP request.

Returns
Type Description
Task<Webhook>

A Webhook objects.

| Improve this Doc View Source

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

to use for the HTTP request.

Returns
Type Description
Task

None.

| Improve this Doc View Source

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

to use for the HTTP request.

Returns
Type Description
Task<Webhook>

The Webhook.

| Improve this Doc View Source

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

to use for the HTTP request.

Returns
Type Description
Task<Webhook>

The updated Webhook.

| Improve this Doc View Source

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

to use for the HTTP request.

Returns
Type Description
Task<Webhook>

The updated Webhook.

| Improve this Doc View Source

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.

Implements

IEasyPostService
IDisposable
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX