Method | Description |
---|---|
CreateWebhook | Create a Webhook |
DeleteWebhook | Delete Webhook By ID |
GetWebhookById | Get Webhook By ID |
ListWebhooks | List Webhooks |
UpdateWebhook | Update a Webhook |
CreateWebhookResponseBody CreateWebhook (CreateWebhookRequestBody createWebhookRequestBody, CancellationToken cancellationToken = default)
CreateWebhookResponseBody CreateWebhook (HttpClient methodClient, CreateWebhookRequestBody createWebhookRequestBody, CancellationToken cancellationToken = default)
Create a Webhook
Create a webook for specific events in the environment.
using System.Collections.Generic;
using System.Diagnostics;
using ShipEngineSDK;
using ShipEngineSDK.Model;
namespace Example
{
public class CreateWebhookExample
{
public static async Task Main()
{
var shipEngine = new ShipEngine("api_key");
var createWebhookRequestBody = new CreateWebhookRequestBody();
try
{
// Create a Webhook
CreateWebhookResponseBody result = await shipEngine.CreateWebhook(createWebhookRequestBody);
Debug.WriteLine(result);
}
catch (ShipEngineException e)
{
Debug.Print("Exception when calling WebhooksApi.CreateWebhook: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
methodClient | HttpClient | The HttpClient instance to use for the request. | |
createWebhookRequestBody | CreateWebhookRequestBody | ||
cancellationToken | CancellationToken | The cancellation token to use for the request. |
string DeleteWebhook (string webhookId, CancellationToken cancellationToken = default)
string DeleteWebhook (HttpClient methodClient, string webhookId, CancellationToken cancellationToken = default)
Delete Webhook By ID
Delete a webhook
using System.Collections.Generic;
using System.Diagnostics;
using ShipEngineSDK;
using ShipEngineSDK.Model;
namespace Example
{
public class DeleteWebhookExample
{
public static async Task Main()
{
var shipEngine = new ShipEngine("api_key");
var webhookId = "webhookId_example";
try
{
// Delete Webhook By ID
string result = await shipEngine.DeleteWebhook(webhookId);
Debug.WriteLine(result);
}
catch (ShipEngineException e)
{
Debug.Print("Exception when calling WebhooksApi.DeleteWebhook: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
methodClient | HttpClient | The HttpClient instance to use for the request. | |
webhookId | string | Webhook ID | |
cancellationToken | CancellationToken | The cancellation token to use for the request. |
string
GetWebhookByIdResponseBody GetWebhookById (string webhookId, CancellationToken cancellationToken = default)
GetWebhookByIdResponseBody GetWebhookById (HttpClient methodClient, string webhookId, CancellationToken cancellationToken = default)
Get Webhook By ID
Retrieve individual webhook by an ID
using System.Collections.Generic;
using System.Diagnostics;
using ShipEngineSDK;
using ShipEngineSDK.Model;
namespace Example
{
public class GetWebhookByIdExample
{
public static async Task Main()
{
var shipEngine = new ShipEngine("api_key");
var webhookId = "webhookId_example";
try
{
// Get Webhook By ID
GetWebhookByIdResponseBody result = await shipEngine.GetWebhookById(webhookId);
Debug.WriteLine(result);
}
catch (ShipEngineException e)
{
Debug.Print("Exception when calling WebhooksApi.GetWebhookById: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
methodClient | HttpClient | The HttpClient instance to use for the request. | |
webhookId | string | Webhook ID | |
cancellationToken | CancellationToken | The cancellation token to use for the request. |
List<Webhook> ListWebhooks (CancellationToken cancellationToken = default)
List<Webhook> ListWebhooks (HttpClient methodClient, CancellationToken cancellationToken = default)
List Webhooks
List all webhooks currently enabled for the account.
using System.Collections.Generic;
using System.Diagnostics;
using ShipEngineSDK;
using ShipEngineSDK.Model;
namespace Example
{
public class ListWebhooksExample
{
public static async Task Main()
{
var shipEngine = new ShipEngine("api_key");
try
{
// List Webhooks
List<Webhook> result = await shipEngine.ListWebhooks();
Debug.WriteLine(result);
}
catch (ShipEngineException e)
{
Debug.Print("Exception when calling WebhooksApi.ListWebhooks: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
methodClient | HttpClient | The HttpClient instance to use for the request. | |
cancellationToken | CancellationToken | The cancellation token to use for the request. |
string UpdateWebhook (UpdateWebhookRequestBody updateWebhookRequestBody, string webhookId, CancellationToken cancellationToken = default)
string UpdateWebhook (HttpClient methodClient, UpdateWebhookRequestBody updateWebhookRequestBody, string webhookId, CancellationToken cancellationToken = default)
Update a Webhook
Update the webhook url property
using System.Collections.Generic;
using System.Diagnostics;
using ShipEngineSDK;
using ShipEngineSDK.Model;
namespace Example
{
public class UpdateWebhookExample
{
public static async Task Main()
{
var shipEngine = new ShipEngine("api_key");
var updateWebhookRequestBody = new UpdateWebhookRequestBody();
var webhookId = "webhookId_example";
try
{
// Update a Webhook
string result = await shipEngine.UpdateWebhook(updateWebhookRequestBody, webhookId);
Debug.WriteLine(result);
}
catch (ShipEngineException e)
{
Debug.Print("Exception when calling WebhooksApi.UpdateWebhook: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
methodClient | HttpClient | The HttpClient instance to use for the request. | |
updateWebhookRequestBody | UpdateWebhookRequestBody | ||
webhookId | string | Webhook ID | |
cancellationToken | CancellationToken | The cancellation token to use for the request. |
string