# mailslurp.api.WebhookControllerApi
# Load the API package
import 'package:mailslurp/api.dart';
All URIs are relative to https://api.mailslurp.com
Method | HTTP request | Description |
---|---|---|
createWebhook | POST /inboxes/{inboxId}/webhooks | Attach a WebHook URL to an inbox |
deleteWebhook | DELETE /inboxes/{inboxId}/webhooks/{webhookId} | Delete and disable a Webhook for an Inbox |
getAllWebhooks | GET /webhooks/paginated | List Webhooks Paginated |
getWebhook | GET /webhooks/{webhookId} | Get a webhook for an Inbox |
getWebhooks | GET /inboxes/{inboxId}/webhooks | Get all Webhooks for an Inbox |
sendTestData | POST /webhooks/{webhookId}/test | Send webhook test data |
# createWebhook
WebhookDto createWebhook(inboxId, webhookOptions)
Attach a WebHook URL to an inbox
Get notified whenever an inbox receives an email via a WebHook URL. An emailID will be posted to this URL every time an email is received for this inbox. The URL must be publicly reachable by the MailSlurp server. You can provide basicAuth values if you wish to secure this endpoint.
# Example
import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';
var api_instance = WebhookControllerApi();
var inboxId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | inboxId
var webhookOptions = CreateWebhookOptions(); // CreateWebhookOptions | webhookOptions
try {
var result = api_instance.createWebhook(inboxId, webhookOptions);
print(result);
} catch (e) {
print("Exception when calling WebhookControllerApi->createWebhook: $e\n");
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
inboxId | String | inboxId | [default to null] |
webhookOptions | CreateWebhookOptions | webhookOptions |
# Return type
# Authorization
# HTTP request headers
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# deleteWebhook
deleteWebhook(inboxId, webhookId)
Delete and disable a Webhook for an Inbox
# Example
import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';
var api_instance = WebhookControllerApi();
var inboxId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | inboxId
var webhookId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | webhookId
try {
api_instance.deleteWebhook(inboxId, webhookId);
} catch (e) {
print("Exception when calling WebhookControllerApi->deleteWebhook: $e\n");
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
inboxId | String | inboxId | [default to null] |
webhookId | String | webhookId | [default to null] |
# Return type
void (empty response body)
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# getAllWebhooks
PageWebhookProjection getAllWebhooks(page, size, sort)
List Webhooks Paginated
List webhooks in paginated form. Allows for page index, page size, and sort direction.
# Example
import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';
var api_instance = WebhookControllerApi();
var page = 56; // int | Optional page index in inbox list pagination
var size = 56; // int | Optional page size in inbox list pagination
var sort = sort_example; // String | Optional createdAt sort direction ASC or DESC
try {
var result = api_instance.getAllWebhooks(page, size, sort);
print(result);
} catch (e) {
print("Exception when calling WebhookControllerApi->getAllWebhooks: $e\n");
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
page | int | Optional page index in inbox list pagination | [optional] [default to 0] |
size | int | Optional page size in inbox list pagination | [optional] [default to 20] |
sort | String | Optional createdAt sort direction ASC or DESC | [optional] [default to "ASC"] |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# getWebhook
WebhookDto getWebhook(webhookId)
Get a webhook for an Inbox
# Example
import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';
var api_instance = WebhookControllerApi();
var webhookId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | webhookId
try {
var result = api_instance.getWebhook(webhookId);
print(result);
} catch (e) {
print("Exception when calling WebhookControllerApi->getWebhook: $e\n");
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
webhookId | String | webhookId | [default to null] |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# getWebhooks
List
getWebhooks(inboxId)
Get all Webhooks for an Inbox
# Example
import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';
var api_instance = WebhookControllerApi();
var inboxId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | inboxId
try {
var result = api_instance.getWebhooks(inboxId);
print(result);
} catch (e) {
print("Exception when calling WebhookControllerApi->getWebhooks: $e\n");
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
inboxId | String | inboxId | [default to null] |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# sendTestData
WebhookTestResult sendTestData(webhookId)
Send webhook test data
# Example
import 'package:mailslurp/api.dart';
// TODO Configure API key authorization: API_KEY
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('API_KEY').apiKeyPrefix = 'Bearer';
var api_instance = WebhookControllerApi();
var webhookId = 38400000-8cf0-11bd-b23e-10b96e4ef00d; // String | webhookId
try {
var result = api_instance.sendTestData(webhookId);
print(result);
} catch (e) {
print("Exception when calling WebhookControllerApi->sendTestData: $e\n");
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
webhookId | String | webhookId | [default to null] |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]