# 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
open class func createWebhook(inboxId: UUID, webhookOptions: CreateWebhookOptions, completion: @escaping (_ data: WebhookDto?, _ error: Error?) -> Void)
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
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp
let inboxId = 987 // UUID | inboxId
let webhookOptions = CreateWebhookOptions(basicAuth: BasicAuthOptions(username: "username_example", password: "password_example"), name: "name_example", url: "url_example") // CreateWebhookOptions | webhookOptions
// Attach a WebHook URL to an inbox
WebhookControllerAPI.createWebhook(inboxId: inboxId, webhookOptions: webhookOptions) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
inboxId | UUID | inboxId | |
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
open class func deleteWebhook(inboxId: UUID, webhookId: UUID, completion: @escaping (_ data: Void?, _ error: Error?) -> Void)
Delete and disable a Webhook for an Inbox
# Example
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp
let inboxId = 987 // UUID | inboxId
let webhookId = 987 // UUID | webhookId
// Delete and disable a Webhook for an Inbox
WebhookControllerAPI.deleteWebhook(inboxId: inboxId, webhookId: webhookId) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
inboxId | UUID | inboxId | |
webhookId | UUID | 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
open class func getAllWebhooks(page: Int? = nil, size: Int? = nil, sort: Sort_getAllWebhooks? = nil, completion: @escaping (_ data: PageWebhookProjection?, _ error: Error?) -> Void)
List Webhooks Paginated
List webhooks in paginated form. Allows for page index, page size, and sort direction.
# Example
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp
let page = 987 // Int | Optional page index in inbox list pagination (optional) (default to 0)
let size = 987 // Int | Optional page size in inbox list pagination (optional) (default to 20)
let sort = "sort_example" // String | Optional createdAt sort direction ASC or DESC (optional) (default to .asc)
// List Webhooks Paginated
WebhookControllerAPI.getAllWebhooks(page: page, size: size, sort: sort) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
# 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
open class func getWebhook(webhookId: UUID, completion: @escaping (_ data: WebhookDto?, _ error: Error?) -> Void)
Get a webhook for an Inbox
# Example
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp
let webhookId = 987 // UUID | webhookId
// Get a webhook for an Inbox
WebhookControllerAPI.getWebhook(webhookId: webhookId) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
webhookId | UUID | 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
open class func getWebhooks(inboxId: UUID, completion: @escaping (_ data: [WebhookDto]?, _ error: Error?) -> Void)
Get all Webhooks for an Inbox
# Example
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp
let inboxId = 987 // UUID | inboxId
// Get all Webhooks for an Inbox
WebhookControllerAPI.getWebhooks(inboxId: inboxId) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
inboxId | UUID | inboxId |
# 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
open class func sendTestData(webhookId: UUID, completion: @escaping (_ data: WebhookTestResult?, _ error: Error?) -> Void)
Send webhook test data
# Example
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import mailslurp
let webhookId = 987 // UUID | webhookId
// Send webhook test data
WebhookControllerAPI.sendTestData(webhookId: webhookId) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
# Parameters
Name | Type | Description | Notes |
---|---|---|---|
webhookId | UUID | 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]