You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.3 KiB
2.3 KiB
LINGYUN.Abp.WebhooksManagement.Application
Webhook management application service module that provides application layer implementation for webhook management.
Features
- Webhook subscription management
- Webhook group management
- Webhook definition management
- Webhook log querying
- Webhook permission management
Module Dependencies
[DependsOn(typeof(AbpWebhooksManagementApplicationModule))]
public class YouProjectModule : AbpModule
{
// other
}
Permission Definitions
- WebhooksManagement.Webhooks
- WebhooksManagement.Webhooks.Create
- WebhooksManagement.Webhooks.Update
- WebhooksManagement.Webhooks.Delete
- WebhooksManagement.Webhooks.ManagePermissions
- WebhooksManagement.Groups
- WebhooksManagement.Groups.Create
- WebhooksManagement.Groups.Update
- WebhooksManagement.Groups.Delete
- WebhooksManagement.Subscriptions
- WebhooksManagement.Subscriptions.Create
- WebhooksManagement.Subscriptions.Update
- WebhooksManagement.Subscriptions.Delete
- WebhooksManagement.Logs
- WebhooksManagement.Logs.Default
Basic Usage
- Manage Webhook Subscriptions
public class YourService
{
private readonly IWebhookSubscriptionAppService _webhookSubscriptionAppService;
public YourService(IWebhookSubscriptionAppService webhookSubscriptionAppService)
{
_webhookSubscriptionAppService = webhookSubscriptionAppService;
}
public async Task ManageSubscription()
{
// Create subscription
await _webhookSubscriptionAppService.CreateAsync(new WebhookSubscriptionCreateDto
{
WebhookUri = "https://your-webhook-endpoint",
Webhooks = new[] { "YourWebhook" }
});
// Query subscriptions
var subscriptions = await _webhookSubscriptionAppService.GetListAsync(
new WebhookSubscriptionGetListInput());
}
}
- Query Webhook Logs
public class YourService
{
private readonly IWebhookSendAttemptAppService _webhookSendAttemptAppService;
public YourService(IWebhookSendAttemptAppService webhookSendAttemptAppService)
{
_webhookSendAttemptAppService = webhookSendAttemptAppService;
}
public async Task QueryLogs()
{
var logs = await _webhookSendAttemptAppService.GetListAsync(
new WebhookSendAttemptGetListInput());
}
}