Skip to content

MailSlurpClient::WebhookControllerApi

All URIs are relative to https://ruby.api.mailslurp.com

Method HTTP request Description
create_account_webhook POST /webhooks Attach a WebHook URL to an inbox
create_webhook POST /inboxes/{inboxId}/webhooks Attach a WebHook URL to an inbox
create_webhook_for_phone_number POST /phone/numbers/{phoneNumberId}/webhooks Attach a WebHook URL to a phone number
delete_all_webhooks DELETE /webhooks Delete all webhooks
delete_webhook DELETE /inboxes/{inboxId}/webhooks/{webhookId} Delete and disable a Webhook for an Inbox
delete_webhook_by_id DELETE /webhooks/{webhookId} Delete a webhook
get_all_account_webhooks GET /webhooks/account/paginated List account webhooks Paginated
get_all_webhook_results GET /webhooks/results Get results for all webhooks
get_all_webhooks GET /webhooks/paginated List Webhooks Paginated
get_inbox_webhooks_paginated GET /inboxes/{inboxId}/webhooks/paginated Get paginated webhooks for an Inbox
get_json_schema_for_webhook_event POST /webhooks/schema
get_json_schema_for_webhook_payload POST /webhooks/{webhookId}/schema
get_phone_number_webhooks_paginated GET /phone/numbers/{phoneId}/webhooks/paginated Get paginated webhooks for a phone number
get_test_webhook_payload GET /webhooks/test
get_test_webhook_payload_bounce GET /webhooks/test/email-bounce-payload
get_test_webhook_payload_bounce_recipient GET /webhooks/test/email-bounce-recipient-payload
get_test_webhook_payload_delivery_status GET /webhooks/test/delivery-status-payload Get webhook test payload for delivery status event
get_test_webhook_payload_email_opened GET /webhooks/test/email-opened-payload
get_test_webhook_payload_email_read GET /webhooks/test/email-read-payload
get_test_webhook_payload_for_webhook POST /webhooks/{webhookId}/example
get_test_webhook_payload_new_attachment GET /webhooks/test/new-attachment-payload Get webhook test payload for new attachment event
get_test_webhook_payload_new_contact GET /webhooks/test/new-contact-payload Get webhook test payload for new contact event
get_test_webhook_payload_new_email GET /webhooks/test/new-email-payload Get webhook test payload for new email event
get_test_webhook_payload_new_sms GET /webhooks/test/new-sms-payload Get webhook test payload for new sms event
get_webhook GET /webhooks/{webhookId} Get a webhook
get_webhook_result GET /webhooks/results/{webhookResultId} Get a webhook result for a webhook
get_webhook_results GET /webhooks/{webhookId}/results Get a webhook results for a webhook
get_webhook_results_unseen_error_count GET /webhooks/results/unseen-count Get count of unseen webhook results with error status
get_webhooks GET /inboxes/{inboxId}/webhooks Get all webhooks for an Inbox
redrive_webhook_result POST /webhooks/results/{webhookResultId}/redrive Get a webhook result and try to resend the original webhook payload
send_test_data POST /webhooks/{webhookId}/test Send webhook test data
update_webhook_headers PUT /webhooks/{webhookId}/headers Update a webhook request headers
verify_webhook_signature POST /webhooks/verify Verify a webhook payload signature

create_account_webhook

WebhookDto create_account_webhook(create_webhook_options)

Attach a WebHook URL to an inbox

Get notified of account level events such as bounce and bounce recipient.

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
create_webhook_options = MailSlurpClient::CreateWebhookOptions.new # CreateWebhookOptions | 

begin
  #Attach a WebHook URL to an inbox
  result = api_instance.create_account_webhook(create_webhook_options)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->create_account_webhook: #{e}"
end

Parameters

Name Type Description Notes
create_webhook_options CreateWebhookOptions

Return type

WebhookDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: /

create_webhook

WebhookDto create_webhook(inbox_id, create_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

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
inbox_id = 'inbox_id_example' # String | 
create_webhook_options = MailSlurpClient::CreateWebhookOptions.new # CreateWebhookOptions | 

begin
  #Attach a WebHook URL to an inbox
  result = api_instance.create_webhook(inbox_id, create_webhook_options)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->create_webhook: #{e}"
end

Parameters

Name Type Description Notes
inbox_id String
create_webhook_options CreateWebhookOptions

Return type

WebhookDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: /

create_webhook_for_phone_number

WebhookDto create_webhook_for_phone_number(phone_number_id, create_webhook_options)

Attach a WebHook URL to a phone number

Get notified whenever a phone number receives an SMS via a WebHook URL.

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
phone_number_id = 'phone_number_id_example' # String | 
create_webhook_options = MailSlurpClient::CreateWebhookOptions.new # CreateWebhookOptions | 

begin
  #Attach a WebHook URL to a phone number
  result = api_instance.create_webhook_for_phone_number(phone_number_id, create_webhook_options)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->create_webhook_for_phone_number: #{e}"
end

Parameters

Name Type Description Notes
phone_number_id String
create_webhook_options CreateWebhookOptions

Return type

WebhookDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: /

delete_all_webhooks

delete_all_webhooks(opts)

Delete all webhooks

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
opts = {
  before: DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | before
}

begin
  #Delete all webhooks
  api_instance.delete_all_webhooks(opts)
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->delete_all_webhooks: #{e}"
end

Parameters

Name Type Description Notes
before DateTime before [optional]

Return type

nil (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

delete_webhook

delete_webhook(inbox_id, webhook_id)

Delete and disable a Webhook for an Inbox

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
inbox_id = 'inbox_id_example' # String | 
webhook_id = 'webhook_id_example' # String | 

begin
  #Delete and disable a Webhook for an Inbox
  api_instance.delete_webhook(inbox_id, webhook_id)
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->delete_webhook: #{e}"
end

Parameters

Name Type Description Notes
inbox_id String
webhook_id String

Return type

nil (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

delete_webhook_by_id

delete_webhook_by_id(webhook_id)

Delete a webhook

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
webhook_id = 'webhook_id_example' # String | 

begin
  #Delete a webhook
  api_instance.delete_webhook_by_id(webhook_id)
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->delete_webhook_by_id: #{e}"
end

Parameters

Name Type Description Notes
webhook_id String

Return type

nil (empty response body)

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

get_all_account_webhooks

PageWebhookProjection get_all_account_webhooks(opts)

List account webhooks Paginated

List account webhooks in paginated form. Allows for page , page size, and sort direction.

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
opts = {
  page: 0, # Integer | Optional page  in list pagination
  size: 20, # Integer | Optional page size for paginated result list.
  sort: 'DESC', # String | Optional createdAt sort direction ASC or DESC
  event_type: 'event_type_example', # String | Optional event type
  since: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter by created at after the given timestamp
  before: DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | Filter by created at before the given timestamp
}

begin
  #List account webhooks Paginated
  result = api_instance.get_all_account_webhooks(opts)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_all_account_webhooks: #{e}"
end

Parameters

Name Type Description Notes
page Integer Optional page in list pagination [optional] [default to 0]
size Integer Optional page size for paginated result list. [optional] [default to 20]
sort String Optional createdAt sort direction ASC or DESC [optional] [default to 'DESC']
event_type String Optional event type [optional]
since DateTime Filter by created at after the given timestamp [optional]
before DateTime Filter by created at before the given timestamp [optional]

Return type

PageWebhookProjection

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_all_webhook_results

PageWebhookResult get_all_webhook_results(opts)

Get results for all webhooks

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
opts = {
  page: 0, # Integer | Optional page  in list pagination
  size: 20, # Integer | Optional page size in list pagination
  sort: 'ASC', # String | Optional createdAt sort direction ASC or DESC
  search_filter: 'search_filter_example', # String | Optional search filter
  since: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter by created at after the given timestamp
  before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter by created at before the given timestamp
  unseen_only: true # Boolean | Filter for unseen exceptions only
}

begin
  #Get results for all webhooks
  result = api_instance.get_all_webhook_results(opts)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_all_webhook_results: #{e}"
end

Parameters

Name Type Description Notes
page Integer Optional page in list pagination [optional] [default to 0]
size Integer Optional page size in list pagination [optional] [default to 20]
sort String Optional createdAt sort direction ASC or DESC [optional] [default to 'ASC']
search_filter String Optional search filter [optional]
since DateTime Filter by created at after the given timestamp [optional]
before DateTime Filter by created at before the given timestamp [optional]
unseen_only Boolean Filter for unseen exceptions only [optional]

Return type

PageWebhookResult

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_all_webhooks

PageWebhookProjection get_all_webhooks(opts)

List Webhooks Paginated

List webhooks in paginated form. Allows for page , page size, and sort direction.

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
opts = {
  page: 0, # Integer | Optional page  in list pagination
  size: 20, # Integer | Optional page size for paginated result list.
  sort: 'DESC', # String | Optional createdAt sort direction ASC or DESC
  search_filter: 'search_filter_example', # String | Optional search filter
  since: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter by created at after the given timestamp
  inbox_id: 'inbox_id_example', # String | Filter by inboxId
  phone_id: 'phone_id_example', # String | Filter by phoneId
  before: DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | Filter by created at before the given timestamp
}

begin
  #List Webhooks Paginated
  result = api_instance.get_all_webhooks(opts)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_all_webhooks: #{e}"
end

Parameters

Name Type Description Notes
page Integer Optional page in list pagination [optional] [default to 0]
size Integer Optional page size for paginated result list. [optional] [default to 20]
sort String Optional createdAt sort direction ASC or DESC [optional] [default to 'DESC']
search_filter String Optional search filter [optional]
since DateTime Filter by created at after the given timestamp [optional]
inbox_id String Filter by inboxId [optional]
phone_id String Filter by phoneId [optional]
before DateTime Filter by created at before the given timestamp [optional]

Return type

PageWebhookProjection

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_inbox_webhooks_paginated

PageWebhookProjection get_inbox_webhooks_paginated(inbox_id, opts)

Get paginated webhooks for an Inbox

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
inbox_id = 'inbox_id_example' # String | 
opts = {
  page: 0, # Integer | Optional page  in list pagination
  size: 20, # Integer | Optional page size in list pagination
  sort: 'ASC', # String | Optional createdAt sort direction ASC or DESC
  search_filter: 'search_filter_example', # String | Optional search filter
  since: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter by created at after the given timestamp
  before: DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | Filter by created at before the given timestamp
}

begin
  #Get paginated webhooks for an Inbox
  result = api_instance.get_inbox_webhooks_paginated(inbox_id, opts)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_inbox_webhooks_paginated: #{e}"
end

Parameters

Name Type Description Notes
inbox_id String
page Integer Optional page in list pagination [optional] [default to 0]
size Integer Optional page size in list pagination [optional] [default to 20]
sort String Optional createdAt sort direction ASC or DESC [optional] [default to 'ASC']
search_filter String Optional search filter [optional]
since DateTime Filter by created at after the given timestamp [optional]
before DateTime Filter by created at before the given timestamp [optional]

Return type

PageWebhookProjection

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_json_schema_for_webhook_event

JSONSchemaDto get_json_schema_for_webhook_event(event)

Get JSON Schema definition for webhook payload by event

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
event = 'event_example' # String | 

begin
  result = api_instance.get_json_schema_for_webhook_event(event)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_json_schema_for_webhook_event: #{e}"
end

Parameters

Name Type Description Notes
event String

Return type

JSONSchemaDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_json_schema_for_webhook_payload

JSONSchemaDto get_json_schema_for_webhook_payload(webhook_id)

Get JSON Schema definition for webhook payload

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
webhook_id = 'webhook_id_example' # String | 

begin
  result = api_instance.get_json_schema_for_webhook_payload(webhook_id)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_json_schema_for_webhook_payload: #{e}"
end

Parameters

Name Type Description Notes
webhook_id String

Return type

JSONSchemaDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_phone_number_webhooks_paginated

PageWebhookProjection get_phone_number_webhooks_paginated(phone_id, opts)

Get paginated webhooks for a phone number

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
phone_id = 'phone_id_example' # String | 
opts = {
  page: 0, # Integer | Optional page  in list pagination
  size: 20, # Integer | Optional page size in list pagination
  sort: 'ASC', # String | Optional createdAt sort direction ASC or DESC
  since: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter by created at after the given timestamp
  before: DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | Filter by created at before the given timestamp
}

begin
  #Get paginated webhooks for a phone number
  result = api_instance.get_phone_number_webhooks_paginated(phone_id, opts)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_phone_number_webhooks_paginated: #{e}"
end

Parameters

Name Type Description Notes
phone_id String
page Integer Optional page in list pagination [optional] [default to 0]
size Integer Optional page size in list pagination [optional] [default to 20]
sort String Optional createdAt sort direction ASC or DESC [optional] [default to 'ASC']
since DateTime Filter by created at after the given timestamp [optional]
before DateTime Filter by created at before the given timestamp [optional]

Return type

PageWebhookProjection

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_test_webhook_payload

AbstractWebhookPayload get_test_webhook_payload(opts)

Get test webhook payload example. Response content depends on eventName passed. Uses EMAIL_RECEIVED as default.

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
opts = {
  event_name: 'event_name_example' # String | 
}

begin
  result = api_instance.get_test_webhook_payload(opts)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_test_webhook_payload: #{e}"
end

Parameters

Name Type Description Notes
event_name String [optional]

Return type

AbstractWebhookPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_test_webhook_payload_bounce

WebhookBouncePayload get_test_webhook_payload_bounce

Get webhook test payload for bounce

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new

begin
  result = api_instance.get_test_webhook_payload_bounce
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_test_webhook_payload_bounce: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

WebhookBouncePayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_test_webhook_payload_bounce_recipient

WebhookBounceRecipientPayload get_test_webhook_payload_bounce_recipient

Get webhook test payload for bounce recipient

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new

begin
  result = api_instance.get_test_webhook_payload_bounce_recipient
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_test_webhook_payload_bounce_recipient: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

WebhookBounceRecipientPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_test_webhook_payload_delivery_status

WebhookDeliveryStatusPayload get_test_webhook_payload_delivery_status

Get webhook test payload for delivery status event

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new

begin
  #Get webhook test payload for delivery status event
  result = api_instance.get_test_webhook_payload_delivery_status
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_test_webhook_payload_delivery_status: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

WebhookDeliveryStatusPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_test_webhook_payload_email_opened

WebhookEmailOpenedPayload get_test_webhook_payload_email_opened

Get webhook test payload for email opened event

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new

begin
  result = api_instance.get_test_webhook_payload_email_opened
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_test_webhook_payload_email_opened: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

WebhookEmailOpenedPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_test_webhook_payload_email_read

WebhookEmailReadPayload get_test_webhook_payload_email_read

Get webhook test payload for email opened event

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new

begin
  result = api_instance.get_test_webhook_payload_email_read
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_test_webhook_payload_email_read: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

WebhookEmailReadPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_test_webhook_payload_for_webhook

AbstractWebhookPayload get_test_webhook_payload_for_webhook(webhook_id)

Get example payload for webhook

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
webhook_id = 'webhook_id_example' # String | 

begin
  result = api_instance.get_test_webhook_payload_for_webhook(webhook_id)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_test_webhook_payload_for_webhook: #{e}"
end

Parameters

Name Type Description Notes
webhook_id String

Return type

AbstractWebhookPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_test_webhook_payload_new_attachment

WebhookNewAttachmentPayload get_test_webhook_payload_new_attachment

Get webhook test payload for new attachment event

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new

begin
  #Get webhook test payload for new attachment event
  result = api_instance.get_test_webhook_payload_new_attachment
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_test_webhook_payload_new_attachment: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

WebhookNewAttachmentPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_test_webhook_payload_new_contact

WebhookNewContactPayload get_test_webhook_payload_new_contact

Get webhook test payload for new contact event

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new

begin
  #Get webhook test payload for new contact event
  result = api_instance.get_test_webhook_payload_new_contact
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_test_webhook_payload_new_contact: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

WebhookNewContactPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_test_webhook_payload_new_email

WebhookNewEmailPayload get_test_webhook_payload_new_email

Get webhook test payload for new email event

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new

begin
  #Get webhook test payload for new email event
  result = api_instance.get_test_webhook_payload_new_email
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_test_webhook_payload_new_email: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

WebhookNewEmailPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_test_webhook_payload_new_sms

WebhookNewSmsPayload get_test_webhook_payload_new_sms

Get webhook test payload for new sms event

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new

begin
  #Get webhook test payload for new sms event
  result = api_instance.get_test_webhook_payload_new_sms
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_test_webhook_payload_new_sms: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

WebhookNewSmsPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_webhook

WebhookDto get_webhook(webhook_id)

Get a webhook

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
webhook_id = 'webhook_id_example' # String | 

begin
  #Get a webhook
  result = api_instance.get_webhook(webhook_id)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_webhook: #{e}"
end

Parameters

Name Type Description Notes
webhook_id String

Return type

WebhookDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_webhook_result

WebhookResultDto get_webhook_result(webhook_result_id)

Get a webhook result for a webhook

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
webhook_result_id = 'webhook_result_id_example' # String | Webhook Result ID

begin
  #Get a webhook result for a webhook
  result = api_instance.get_webhook_result(webhook_result_id)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_webhook_result: #{e}"
end

Parameters

Name Type Description Notes
webhook_result_id String Webhook Result ID

Return type

WebhookResultDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_webhook_results

PageWebhookResult get_webhook_results(webhook_id, opts)

Get a webhook results for a webhook

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
webhook_id = 'webhook_id_example' # String | ID of webhook to get results for
opts = {
  page: 0, # Integer | Optional page  in list pagination
  size: 20, # Integer | Optional page size in list pagination
  sort: 'ASC', # String | Optional createdAt sort direction ASC or DESC
  search_filter: 'search_filter_example', # String | Optional search filter
  since: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter by created at after the given timestamp
  before: DateTime.parse('2013-10-20T19:20:30+01:00'), # DateTime | Filter by created at before the given timestamp
  unseen_only: true # Boolean | Filter for unseen exceptions only
}

begin
  #Get a webhook results for a webhook
  result = api_instance.get_webhook_results(webhook_id, opts)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_webhook_results: #{e}"
end

Parameters

Name Type Description Notes
webhook_id String ID of webhook to get results for
page Integer Optional page in list pagination [optional] [default to 0]
size Integer Optional page size in list pagination [optional] [default to 20]
sort String Optional createdAt sort direction ASC or DESC [optional] [default to 'ASC']
search_filter String Optional search filter [optional]
since DateTime Filter by created at after the given timestamp [optional]
before DateTime Filter by created at before the given timestamp [optional]
unseen_only Boolean Filter for unseen exceptions only [optional]

Return type

PageWebhookResult

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_webhook_results_unseen_error_count

UnseenErrorCountDto get_webhook_results_unseen_error_count

Get count of unseen webhook results with error status

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new

begin
  #Get count of unseen webhook results with error status
  result = api_instance.get_webhook_results_unseen_error_count
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_webhook_results_unseen_error_count: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

UnseenErrorCountDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

get_webhooks

Array get_webhooks(inbox_id)

Get all webhooks for an Inbox

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
inbox_id = 'inbox_id_example' # String | 

begin
  #Get all webhooks for an Inbox
  result = api_instance.get_webhooks(inbox_id)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->get_webhooks: #{e}"
end

Parameters

Name Type Description Notes
inbox_id String

Return type

Array

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

redrive_webhook_result

WebhookRedriveResult redrive_webhook_result(webhook_result_id)

Get a webhook result and try to resend the original webhook payload

Allows you to resend a webhook payload that was already sent. Webhooks that fail are retried automatically for 24 hours and then put in a dead letter queue. You can retry results manually using this method.

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
webhook_result_id = 'webhook_result_id_example' # String | Webhook Result ID

begin
  #Get a webhook result and try to resend the original webhook payload
  result = api_instance.redrive_webhook_result(webhook_result_id)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->redrive_webhook_result: #{e}"
end

Parameters

Name Type Description Notes
webhook_result_id String Webhook Result ID

Return type

WebhookRedriveResult

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

send_test_data

WebhookTestResult send_test_data(webhook_id)

Send webhook test data

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
webhook_id = 'webhook_id_example' # String | 

begin
  #Send webhook test data
  result = api_instance.send_test_data(webhook_id)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->send_test_data: #{e}"
end

Parameters

Name Type Description Notes
webhook_id String

Return type

WebhookTestResult

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

update_webhook_headers

WebhookDto update_webhook_headers(webhook_id, webhook_headers)

Update a webhook request headers

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
webhook_id = 'webhook_id_example' # String | 
webhook_headers = MailSlurpClient::WebhookHeaders.new # WebhookHeaders | 

begin
  #Update a webhook request headers
  result = api_instance.update_webhook_headers(webhook_id, webhook_headers)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->update_webhook_headers: #{e}"
end

Parameters

Name Type Description Notes
webhook_id String
webhook_headers WebhookHeaders

Return type

WebhookDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: /

verify_webhook_signature

VerifyWebhookSignatureResults verify_webhook_signature(verify_webhook_signature_options)

Verify a webhook payload signature

Verify a webhook payload using the messageId and signature. This allows you to be sure that MailSlurp sent the payload and not another server.

Example

# load the gem
require 'mailslurp_client'
# setup authorization
MailSlurpClient.configure do |config|
  # Configure API key authorization: API_KEY
  config.api_key['x-api-key'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['x-api-key'] = 'Bearer'
end

api_instance = MailSlurpClient::WebhookControllerApi.new
verify_webhook_signature_options = MailSlurpClient::VerifyWebhookSignatureOptions.new # VerifyWebhookSignatureOptions | 

begin
  #Verify a webhook payload signature
  result = api_instance.verify_webhook_signature(verify_webhook_signature_options)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling WebhookControllerApi->verify_webhook_signature: #{e}"
end

Parameters

Name Type Description Notes
verify_webhook_signature_options VerifyWebhookSignatureOptions

Return type

VerifyWebhookSignatureResults

Authorization

API_KEY

HTTP request headers

  • Content-Type: application/json
  • Accept: /