Skip to content

MailSlurp::WebhookControllerApi

Load the API package

use MailSlurp::Object::WebhookControllerApi;

All URIs are relative to https://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_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_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_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

WebhookDto create_account_webhook(create_webhook_options => $create_webhook_options)

Attach a WebHook URL to an inbox

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

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $create_webhook_options = MailSlurp::Object::CreateWebhookOptions->new(); # CreateWebhookOptions | 

eval { 
    my $result = $api_instance->create_account_webhook(create_webhook_options => $create_webhook_options);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->create_account_webhook: $@n";
}

Parameters

Name Type Description Notes
create_webhook_options CreateWebhookOptions

Return type

WebhookDto

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]

WebhookDto create_webhook(inbox_id => $inbox_id, create_webhook_options => $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

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $inbox_id = null; # string | 
my $create_webhook_options = MailSlurp::Object::CreateWebhookOptions->new(); # CreateWebhookOptions | 

eval { 
    my $result = $api_instance->create_webhook(inbox_id => $inbox_id, create_webhook_options => $create_webhook_options);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->create_webhook: $@n";
}

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: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

WebhookDto create_webhook_for_phone_number(phone_number_id => $phone_number_id, create_webhook_options => $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

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $phone_number_id = null; # string | 
my $create_webhook_options = MailSlurp::Object::CreateWebhookOptions->new(); # CreateWebhookOptions | 

eval { 
    my $result = $api_instance->create_webhook_for_phone_number(phone_number_id => $phone_number_id, create_webhook_options => $create_webhook_options);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->create_webhook_for_phone_number: $@n";
}

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: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

delete_all_webhooks(before => $before)

Delete all webhooks

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $before = DateTime->from_epoch(epoch => str2time('null')); # DateTime | before

eval { 
    $api_instance->delete_all_webhooks(before => $before);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->delete_all_webhooks: $@n";
}

Parameters

Name Type Description Notes
before DateTime before [optional]

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]

delete_webhook(inbox_id => $inbox_id, webhook_id => $webhook_id)

Delete and disable a Webhook for an Inbox

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $inbox_id = null; # string | 
my $webhook_id = null; # string | 

eval { 
    $api_instance->delete_webhook(inbox_id => $inbox_id, webhook_id => $webhook_id);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->delete_webhook: $@n";
}

Parameters

Name Type Description Notes
inbox_id string
webhook_id string

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]

delete_webhook_by_id(webhook_id => $webhook_id)

Delete a webhook

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $webhook_id = null; # string | 

eval { 
    $api_instance->delete_webhook_by_id(webhook_id => $webhook_id);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->delete_webhook_by_id: $@n";
}

Parameters

Name Type Description Notes
webhook_id string

Return type

void (empty response body)

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]

PageWebhookResult get_all_webhook_results(page => $page, size => $size, sort => $sort, search_filter => $search_filter, since => $since, before => $before, unseen_only => $unseen_only)

Get results for all webhooks

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $page = 0; # int | Optional page  in list pagination
my $size = 20; # int | Optional page size in list pagination
my $sort = 'ASC'; # string | Optional createdAt sort direction ASC or DESC
my $search_filter = "search_filter_example"; # string | Optional search filter
my $since = DateTime->from_epoch(epoch => str2time('null')); # DateTime | Filter by created at after the given timestamp
my $before = DateTime->from_epoch(epoch => str2time('null')); # DateTime | Filter by created at before the given timestamp
my $unseen_only = null; # boolean | Filter for unseen exceptions only

eval { 
    my $result = $api_instance->get_all_webhook_results(page => $page, size => $size, sort => $sort, search_filter => $search_filter, since => $since, before => $before, unseen_only => $unseen_only);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_all_webhook_results: $@n";
}

Parameters

Name Type Description Notes
page int Optional page in list pagination [optional] [default to 0]
size int 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: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

PageWebhookProjection get_all_webhooks(page => $page, size => $size, sort => $sort, search_filter => $search_filter, since => $since, inbox_id => $inbox_id, phone_id => $phone_id, before => $before)

List Webhooks Paginated

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

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $page = 0; # int | Optional page  in list pagination
my $size = 20; # int | Optional page size for paginated result list.
my $sort = 'DESC'; # string | Optional createdAt sort direction ASC or DESC
my $search_filter = "search_filter_example"; # string | Optional search filter
my $since = DateTime->from_epoch(epoch => str2time('null')); # DateTime | Filter by created at after the given timestamp
my $inbox_id = null; # string | Filter by inboxId
my $phone_id = null; # string | Filter by phoneId
my $before = DateTime->from_epoch(epoch => str2time('null')); # DateTime | Filter by created at before the given timestamp

eval { 
    my $result = $api_instance->get_all_webhooks(page => $page, size => $size, sort => $sort, search_filter => $search_filter, since => $since, inbox_id => $inbox_id, phone_id => $phone_id, before => $before);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_all_webhooks: $@n";
}

Parameters

Name Type Description Notes
page int Optional page in list pagination [optional] [default to 0]
size int 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: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

PageWebhookProjection get_inbox_webhooks_paginated(inbox_id => $inbox_id, page => $page, size => $size, sort => $sort, search_filter => $search_filter, since => $since, before => $before)

Get paginated webhooks for an Inbox

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $inbox_id = null; # string | 
my $page = 0; # int | Optional page  in list pagination
my $size = 20; # int | Optional page size in list pagination
my $sort = 'ASC'; # string | Optional createdAt sort direction ASC or DESC
my $search_filter = "search_filter_example"; # string | Optional search filter
my $since = DateTime->from_epoch(epoch => str2time('null')); # DateTime | Filter by created at after the given timestamp
my $before = DateTime->from_epoch(epoch => str2time('null')); # DateTime | Filter by created at before the given timestamp

eval { 
    my $result = $api_instance->get_inbox_webhooks_paginated(inbox_id => $inbox_id, page => $page, size => $size, sort => $sort, search_filter => $search_filter, since => $since, before => $before);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_inbox_webhooks_paginated: $@n";
}

Parameters

Name Type Description Notes
inbox_id string
page int Optional page in list pagination [optional] [default to 0]
size int 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: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

JSONSchemaDto get_json_schema_for_webhook_event(event => $event)

Get JSON Schema definition for webhook payload by event

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $event = "event_example"; # string | 

eval { 
    my $result = $api_instance->get_json_schema_for_webhook_event(event => $event);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_json_schema_for_webhook_event: $@n";
}

Parameters

Name Type Description Notes
event string

Return type

JSONSchemaDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

JSONSchemaDto get_json_schema_for_webhook_payload(webhook_id => $webhook_id)

Get JSON Schema definition for webhook payload

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $webhook_id = null; # string | 

eval { 
    my $result = $api_instance->get_json_schema_for_webhook_payload(webhook_id => $webhook_id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_json_schema_for_webhook_payload: $@n";
}

Parameters

Name Type Description Notes
webhook_id string

Return type

JSONSchemaDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

PageWebhookProjection get_phone_number_webhooks_paginated(phone_id => $phone_id, page => $page, size => $size, sort => $sort, since => $since, before => $before)

Get paginated webhooks for a phone number

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $phone_id = null; # string | 
my $page = 0; # int | Optional page  in list pagination
my $size = 20; # int | Optional page size in list pagination
my $sort = 'ASC'; # string | Optional createdAt sort direction ASC or DESC
my $since = DateTime->from_epoch(epoch => str2time('null')); # DateTime | Filter by created at after the given timestamp
my $before = DateTime->from_epoch(epoch => str2time('null')); # DateTime | Filter by created at before the given timestamp

eval { 
    my $result = $api_instance->get_phone_number_webhooks_paginated(phone_id => $phone_id, page => $page, size => $size, sort => $sort, since => $since, before => $before);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_phone_number_webhooks_paginated: $@n";
}

Parameters

Name Type Description Notes
phone_id string
page int Optional page in list pagination [optional] [default to 0]
size int 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: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

AbstractWebhookPayload get_test_webhook_payload(event_name => $event_name)

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

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $event_name = "event_name_example"; # string | 

eval { 
    my $result = $api_instance->get_test_webhook_payload(event_name => $event_name);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_test_webhook_payload: $@n";
}

Parameters

Name Type Description Notes
event_name string [optional]

Return type

AbstractWebhookPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

WebhookBouncePayload get_test_webhook_payload_bounce()

Get webhook test payload for bounce

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);


eval { 
    my $result = $api_instance->get_test_webhook_payload_bounce();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_test_webhook_payload_bounce: $@n";
}

Parameters

This endpoint does not need any parameter.

Return type

WebhookBouncePayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

WebhookBounceRecipientPayload get_test_webhook_payload_bounce_recipient()

Get webhook test payload for bounce recipient

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);


eval { 
    my $result = $api_instance->get_test_webhook_payload_bounce_recipient();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_test_webhook_payload_bounce_recipient: $@n";
}

Parameters

This endpoint does not need any parameter.

Return type

WebhookBounceRecipientPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

WebhookEmailOpenedPayload get_test_webhook_payload_email_opened()

Get webhook test payload for email opened event

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);


eval { 
    my $result = $api_instance->get_test_webhook_payload_email_opened();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_test_webhook_payload_email_opened: $@n";
}

Parameters

This endpoint does not need any parameter.

Return type

WebhookEmailOpenedPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

WebhookEmailReadPayload get_test_webhook_payload_email_read()

Get webhook test payload for email opened event

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);


eval { 
    my $result = $api_instance->get_test_webhook_payload_email_read();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_test_webhook_payload_email_read: $@n";
}

Parameters

This endpoint does not need any parameter.

Return type

WebhookEmailReadPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

AbstractWebhookPayload get_test_webhook_payload_for_webhook(webhook_id => $webhook_id)

Get example payload for webhook

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $webhook_id = null; # string | 

eval { 
    my $result = $api_instance->get_test_webhook_payload_for_webhook(webhook_id => $webhook_id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_test_webhook_payload_for_webhook: $@n";
}

Parameters

Name Type Description Notes
webhook_id string

Return type

AbstractWebhookPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

WebhookNewAttachmentPayload get_test_webhook_payload_new_attachment()

Get webhook test payload for new attachment event

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);


eval { 
    my $result = $api_instance->get_test_webhook_payload_new_attachment();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_test_webhook_payload_new_attachment: $@n";
}

Parameters

This endpoint does not need any parameter.

Return type

WebhookNewAttachmentPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

WebhookNewContactPayload get_test_webhook_payload_new_contact()

Get webhook test payload for new contact event

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);


eval { 
    my $result = $api_instance->get_test_webhook_payload_new_contact();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_test_webhook_payload_new_contact: $@n";
}

Parameters

This endpoint does not need any parameter.

Return type

WebhookNewContactPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

WebhookNewEmailPayload get_test_webhook_payload_new_email()

Get webhook test payload for new email event

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);


eval { 
    my $result = $api_instance->get_test_webhook_payload_new_email();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_test_webhook_payload_new_email: $@n";
}

Parameters

This endpoint does not need any parameter.

Return type

WebhookNewEmailPayload

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

WebhookDto get_webhook(webhook_id => $webhook_id)

Get a webhook

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $webhook_id = null; # string | 

eval { 
    my $result = $api_instance->get_webhook(webhook_id => $webhook_id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_webhook: $@n";
}

Parameters

Name Type Description Notes
webhook_id string

Return type

WebhookDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

WebhookResultDto get_webhook_result(webhook_result_id => $webhook_result_id)

Get a webhook result for a webhook

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $webhook_result_id = null; # string | Webhook Result ID

eval { 
    my $result = $api_instance->get_webhook_result(webhook_result_id => $webhook_result_id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_webhook_result: $@n";
}

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: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

PageWebhookResult get_webhook_results(webhook_id => $webhook_id, page => $page, size => $size, sort => $sort, search_filter => $search_filter, since => $since, before => $before, unseen_only => $unseen_only)

Get a webhook results for a webhook

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $webhook_id = null; # string | ID of webhook to get results for
my $page = 0; # int | Optional page  in list pagination
my $size = 20; # int | Optional page size in list pagination
my $sort = 'ASC'; # string | Optional createdAt sort direction ASC or DESC
my $search_filter = "search_filter_example"; # string | Optional search filter
my $since = DateTime->from_epoch(epoch => str2time('null')); # DateTime | Filter by created at after the given timestamp
my $before = DateTime->from_epoch(epoch => str2time('null')); # DateTime | Filter by created at before the given timestamp
my $unseen_only = null; # boolean | Filter for unseen exceptions only

eval { 
    my $result = $api_instance->get_webhook_results(webhook_id => $webhook_id, page => $page, size => $size, sort => $sort, search_filter => $search_filter, since => $since, before => $before, unseen_only => $unseen_only);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_webhook_results: $@n";
}

Parameters

Name Type Description Notes
webhook_id string ID of webhook to get results for
page int Optional page in list pagination [optional] [default to 0]
size int 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: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

UnseenErrorCountDto get_webhook_results_unseen_error_count()

Get count of unseen webhook results with error status

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);


eval { 
    my $result = $api_instance->get_webhook_results_unseen_error_count();
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_webhook_results_unseen_error_count: $@n";
}

Parameters

This endpoint does not need any parameter.

Return type

UnseenErrorCountDto

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

ARRAY[WebhookDto] get_webhooks(inbox_id => $inbox_id)

Get all webhooks for an Inbox

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $inbox_id = null; # string | 

eval { 
    my $result = $api_instance->get_webhooks(inbox_id => $inbox_id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->get_webhooks: $@n";
}

Parameters

Name Type Description Notes
inbox_id string

Return type

ARRAY[WebhookDto]

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

WebhookRedriveResult redrive_webhook_result(webhook_result_id => $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

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $webhook_result_id = null; # string | Webhook Result ID

eval { 
    my $result = $api_instance->redrive_webhook_result(webhook_result_id => $webhook_result_id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->redrive_webhook_result: $@n";
}

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: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

WebhookTestResult send_test_data(webhook_id => $webhook_id)

Send webhook test data

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $webhook_id = null; # string | 

eval { 
    my $result = $api_instance->send_test_data(webhook_id => $webhook_id);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->send_test_data: $@n";
}

Parameters

Name Type Description Notes
webhook_id string

Return type

WebhookTestResult

Authorization

API_KEY

HTTP request headers

  • Content-Type: Not defined
  • Accept: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

WebhookDto update_webhook_headers(webhook_id => $webhook_id, webhook_headers => $webhook_headers)

Update a webhook request headers

Example

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $webhook_id = null; # string | 
my $webhook_headers = MailSlurp::Object::WebhookHeaders->new(); # WebhookHeaders | 

eval { 
    my $result = $api_instance->update_webhook_headers(webhook_id => $webhook_id, webhook_headers => $webhook_headers);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->update_webhook_headers: $@n";
}

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: /

[Back to top] [Back to API list] [Back to Model list] [Back to ]

VerifyWebhookSignatureResults verify_webhook_signature(verify_webhook_signature_options => $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

use Data::Dumper;
use MailSlurp::WebhookControllerApi;
my $api_instance = MailSlurp::WebhookControllerApi->new(

    # Configure API key authorization: API_KEY
    api_key => {'x-api-key' => 'YOUR_API_KEY'},
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #api_key_prefix => {'x-api-key' => 'Bearer'},
);

my $verify_webhook_signature_options = MailSlurp::Object::VerifyWebhookSignatureOptions->new(); # VerifyWebhookSignatureOptions | 

eval { 
    my $result = $api_instance->verify_webhook_signature(verify_webhook_signature_options => $verify_webhook_signature_options);
    print Dumper($result);
};
if ($@) {
    warn "Exception when calling WebhookControllerApi->verify_webhook_signature: $@n";
}

Parameters

Name Type Description Notes
verify_webhook_signature_options VerifyWebhookSignatureOptions

Return type

VerifyWebhookSignatureResults

Authorization

API_KEY

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to ]