# mailslurp_client.WebhookControllerApi
All URIs are relative to https://api.mailslurp.com
Method | HTTP request | Description |
---|---|---|
create_webhook | POST /inboxes/{inboxId}/webhooks | Attach a WebHook URL to an inbox |
delete_webhook | DELETE /inboxes/{inboxId}/webhooks/{webhookId} | Delete and disable a Webhook for an Inbox |
get_all_webhooks | GET /webhooks/paginated | List Webhooks Paginated |
get_webhook | GET /webhooks/{webhookId} | Get a webhook for an Inbox |
get_webhooks | GET /inboxes/{inboxId}/webhooks | Get all Webhooks for an Inbox |
send_test_data | POST /webhooks/{webhookId}/test | Send webhook test data |
# create_webhook
WebhookDto create_webhook(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
- Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com",
api_key = {
'x-api-key': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mailslurp_client.WebhookControllerApi(api_client)
inbox_id = 'inbox_id_example' # str | inboxId
webhook_options = mailslurp_client.CreateWebhookOptions() # CreateWebhookOptions | webhookOptions
try:
# Attach a WebHook URL to an inbox
api_response = api_instance.create_webhook(inbox_id, webhook_options)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhookControllerApi->create_webhook: %s\n" % e)
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
inbox_id | str | inboxId | |
webhook_options | CreateWebhookOptions | webhookOptions |
# Return type
# Authorization
# HTTP request headers
- Content-Type: application/json
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# delete_webhook
delete_webhook(inbox_id, webhook_id)
Delete and disable a Webhook for an Inbox
# Example
- Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com",
api_key = {
'x-api-key': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mailslurp_client.WebhookControllerApi(api_client)
inbox_id = 'inbox_id_example' # str | inboxId
webhook_id = 'webhook_id_example' # str | webhookId
try:
# Delete and disable a Webhook for an Inbox
api_instance.delete_webhook(inbox_id, webhook_id)
except ApiException as e:
print("Exception when calling WebhookControllerApi->delete_webhook: %s\n" % e)
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
inbox_id | str | inboxId | |
webhook_id | str | webhookId |
# Return type
void (empty response body)
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: Not defined
# HTTP response details
Status code | Description | Response headers |
---|---|---|
204 | No Content | - |
401 | Unauthorized | - |
403 | Forbidden | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# get_all_webhooks
PageWebhookProjection get_all_webhooks(page=page, size=size, sort=sort)
List Webhooks Paginated
List webhooks in paginated form. Allows for page index, page size, and sort direction.
# Example
- Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com",
api_key = {
'x-api-key': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mailslurp_client.WebhookControllerApi(api_client)
page = 0 # int | Optional page index in inbox list pagination (optional) (default to 0)
size = 20 # int | Optional page size in inbox list pagination (optional) (default to 20)
sort = 'ASC' # str | Optional createdAt sort direction ASC or DESC (optional) (default to 'ASC')
try:
# List Webhooks Paginated
api_response = api_instance.get_all_webhooks(page=page, size=size, sort=sort)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhookControllerApi->get_all_webhooks: %s\n" % e)
# 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 | str | Optional createdAt sort direction ASC or DESC | [optional] [default to 'ASC'] |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# get_webhook
WebhookDto get_webhook(webhook_id)
Get a webhook for an Inbox
# Example
- Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com",
api_key = {
'x-api-key': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mailslurp_client.WebhookControllerApi(api_client)
webhook_id = 'webhook_id_example' # str | webhookId
try:
# Get a webhook for an Inbox
api_response = api_instance.get_webhook(webhook_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhookControllerApi->get_webhook: %s\n" % e)
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
webhook_id | str | webhookId |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# get_webhooks
list[WebhookDto] get_webhooks(inbox_id)
Get all Webhooks for an Inbox
# Example
- Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com",
api_key = {
'x-api-key': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mailslurp_client.WebhookControllerApi(api_client)
inbox_id = 'inbox_id_example' # str | inboxId
try:
# Get all Webhooks for an Inbox
api_response = api_instance.get_webhooks(inbox_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhookControllerApi->get_webhooks: %s\n" % e)
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
inbox_id | str | inboxId |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
# send_test_data
WebhookTestResult send_test_data(webhook_id)
Send webhook test data
# Example
- Api Key Authentication (API_KEY):
from __future__ import print_function
import time
import mailslurp_client
from mailslurp_client.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to https://api.mailslurp.com
# See configuration.py for a list of all supported configuration parameters.
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com"
)
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure API key authorization: API_KEY
configuration = mailslurp_client.Configuration(
host = "https://api.mailslurp.com",
api_key = {
'x-api-key': 'YOUR_API_KEY'
}
)
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['x-api-key'] = 'Bearer'
# Enter a context with an instance of the API client
with mailslurp_client.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = mailslurp_client.WebhookControllerApi(api_client)
webhook_id = 'webhook_id_example' # str | webhookId
try:
# Send webhook test data
api_response = api_instance.send_test_data(webhook_id)
pprint(api_response)
except ApiException as e:
print("Exception when calling WebhookControllerApi->send_test_data: %s\n" % e)
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
webhook_id | str | webhookId |
# Return type
# Authorization
# HTTP request headers
- Content-Type: Not defined
- Accept: application/json
# HTTP response details
Status code | Description | Response headers |
---|---|---|
201 | Created | - |
401 | Unauthorized | - |
403 | Forbidden | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]