# MailSlurp\WebhookControllerApi
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
\MailSlurp\Models\WebhookDto createWebhook($inbox_id, $webhook_options)
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
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: API_KEY
$config = MailSlurp\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurp\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new MailSlurp\Api\WebhookControllerApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$inbox_id = 'inbox_id_example'; // string | inboxId
$webhook_options = new \MailSlurp\Models\CreateWebhookOptions(); // \MailSlurp\Models\CreateWebhookOptions | webhookOptions
try {
$result = $apiInstance->createWebhook($inbox_id, $webhook_options);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling WebhookControllerApi->createWebhook: ', $e->getMessage(), PHP_EOL;
}
?>
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
inbox_id | string | inboxId | |
webhook_options | \MailSlurp\Models\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($inbox_id, $webhook_id)
Delete and disable a Webhook for an Inbox
# Example
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: API_KEY
$config = MailSlurp\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurp\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new MailSlurp\Api\WebhookControllerApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$inbox_id = 'inbox_id_example'; // string | inboxId
$webhook_id = 'webhook_id_example'; // string | webhookId
try {
$apiInstance->deleteWebhook($inbox_id, $webhook_id);
} catch (Exception $e) {
echo 'Exception when calling WebhookControllerApi->deleteWebhook: ', $e->getMessage(), PHP_EOL;
}
?>
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
inbox_id | string | inboxId | |
webhook_id | string | webhookId |
# 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
\MailSlurp\Models\PageWebhookProjection getAllWebhooks($page, $size, $sort)
List Webhooks Paginated
List webhooks in paginated form. Allows for page index, page size, and sort direction.
# Example
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: API_KEY
$config = MailSlurp\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurp\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new MailSlurp\Api\WebhookControllerApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$page = 0; // int | Optional page index in inbox list pagination
$size = 20; // int | Optional page size in inbox list pagination
$sort = 'ASC'; // string | Optional createdAt sort direction ASC or DESC
try {
$result = $apiInstance->getAllWebhooks($page, $size, $sort);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling WebhookControllerApi->getAllWebhooks: ', $e->getMessage(), PHP_EOL;
}
?>
# 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
\MailSlurp\Models\PageWebhookProjection
# 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
\MailSlurp\Models\WebhookDto getWebhook($webhook_id)
Get a webhook for an Inbox
# Example
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: API_KEY
$config = MailSlurp\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurp\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new MailSlurp\Api\WebhookControllerApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$webhook_id = 'webhook_id_example'; // string | webhookId
try {
$result = $apiInstance->getWebhook($webhook_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling WebhookControllerApi->getWebhook: ', $e->getMessage(), PHP_EOL;
}
?>
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
webhook_id | string | webhookId |
# 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
\MailSlurp\Models\WebhookDto[] getWebhooks($inbox_id)
Get all Webhooks for an Inbox
# Example
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: API_KEY
$config = MailSlurp\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurp\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new MailSlurp\Api\WebhookControllerApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$inbox_id = 'inbox_id_example'; // string | inboxId
try {
$result = $apiInstance->getWebhooks($inbox_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling WebhookControllerApi->getWebhooks: ', $e->getMessage(), PHP_EOL;
}
?>
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
inbox_id | string | inboxId |
# Return type
\MailSlurp\Models\WebhookDto[]
# 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
\MailSlurp\Models\WebhookTestResult sendTestData($webhook_id)
Send webhook test data
# Example
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: API_KEY
$config = MailSlurp\Configuration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurp\Configuration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new MailSlurp\Api\WebhookControllerApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$webhook_id = 'webhook_id_example'; // string | webhookId
try {
$result = $apiInstance->sendTestData($webhook_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling WebhookControllerApi->sendTestData: ', $e->getMessage(), PHP_EOL;
}
?>
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
webhook_id | string | webhookId |
# Return type
\MailSlurp\Models\WebhookTestResult
# 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]