# MailSlurpClient::ExtraOperationsApi All URIs are relative to *https://api.mailslurp.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**bulk_create_inboxes**](ExtraOperationsApi.md#bulk_create_inboxes) | **POST** /bulk/inboxes | Bulk create Inboxes (email addresses) [**bulk_delete_inboxes**](ExtraOperationsApi.md#bulk_delete_inboxes) | **DELETE** /bulk/inboxes | Bulk Delete Inboxes [**bulk_send_emails**](ExtraOperationsApi.md#bulk_send_emails) | **POST** /bulk/send | Bulk Send Emails [**create_inbox**](ExtraOperationsApi.md#create_inbox) | **POST** /inboxes | Create an Inbox (email address) [**create_webhook**](ExtraOperationsApi.md#create_webhook) | **POST** /inboxes/{inboxId}/webhooks | Attach a WebHook URL to an inbox [**delete_email**](ExtraOperationsApi.md#delete_email) | **DELETE** /emails/{emailId} | Delete Email [**delete_inbox**](ExtraOperationsApi.md#delete_inbox) | **DELETE** /inboxes/{inboxId} | Delete Inbox / Email Address [**delete_webhook**](ExtraOperationsApi.md#delete_webhook) | **DELETE** /inboxes/{inboxId}/webhooks/{webhookId} | Delete and disable a WebHook for an Inbox [**download_attachment**](ExtraOperationsApi.md#download_attachment) | **GET** /emails/{emailId}/attachments/{attachmentId} | Get email attachment [**get_email**](ExtraOperationsApi.md#get_email) | **GET** /emails/{emailId} | Get Email Content [**get_emails**](ExtraOperationsApi.md#get_emails) | **GET** /inboxes/{inboxId}/emails | List Emails in an Inbox / EmailAddress [**get_inbox**](ExtraOperationsApi.md#get_inbox) | **GET** /inboxes/{inboxId} | Get Inbox / EmailAddress [**get_inboxes**](ExtraOperationsApi.md#get_inboxes) | **GET** /inboxes | List Inboxes / Email Addresses [**get_raw_email_contents**](ExtraOperationsApi.md#get_raw_email_contents) | **GET** /emails/{emailId}/raw | Get Raw Email Content [**get_webhooks**](ExtraOperationsApi.md#get_webhooks) | **GET** /inboxes/{inboxId}/webhooks | Get all WebHooks for an Inbox [**send_email**](ExtraOperationsApi.md#send_email) | **POST** /inboxes/{inboxId} | Send Email # **bulk_create_inboxes** > Array<Inbox> bulk_create_inboxes(count) Bulk create Inboxes (email addresses) Enterprise Plan Required ### Example ```ruby # 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::ExtraOperationsApi.new count = 56 # Integer | Number of inboxes to be created in bulk begin #Bulk create Inboxes (email addresses) result = api_instance.bulk_create_inboxes(count) p result rescue MailSlurpClient::ApiError => e puts "Exception when calling ExtraOperationsApi->bulk_create_inboxes: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **count** | **Integer**| Number of inboxes to be created in bulk | ### Return type [**Array<Inbox>**](Inbox.md) ### Authorization [API_KEY](../README.md#API_KEY) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json # **bulk_delete_inboxes** > bulk_delete_inboxes(request_body) Bulk Delete Inboxes Enterprise Plan Required ### Example ```ruby # 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::ExtraOperationsApi.new request_body = nil # Array | ids begin #Bulk Delete Inboxes api_instance.bulk_delete_inboxes(request_body) rescue MailSlurpClient::ApiError => e puts "Exception when calling ExtraOperationsApi->bulk_delete_inboxes: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **request_body** | [**Array<String>**](Array.md)| ids | ### Return type nil (empty response body) ### Authorization [API_KEY](../README.md#API_KEY) ### HTTP request headers - **Content-Type**: application/json - **Accept**: Not defined # **bulk_send_emails** > bulk_send_emails(bulk_send_email_options) Bulk Send Emails Enterprise Plan Required ### Example ```ruby # 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::ExtraOperationsApi.new bulk_send_email_options = MailSlurpClient::BulkSendEmailOptions.new # BulkSendEmailOptions | bulkSendEmailOptions begin #Bulk Send Emails api_instance.bulk_send_emails(bulk_send_email_options) rescue MailSlurpClient::ApiError => e puts "Exception when calling ExtraOperationsApi->bulk_send_emails: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **bulk_send_email_options** | [**BulkSendEmailOptions**](BulkSendEmailOptions.md)| bulkSendEmailOptions | ### Return type nil (empty response body) ### Authorization [API_KEY](../README.md#API_KEY) ### HTTP request headers - **Content-Type**: application/json - **Accept**: Not defined # **create_inbox** > Inbox create_inbox Create an Inbox (email address) Create a new inbox and ephemeral email address to send and receive from. This is a necessary step before sending or receiving emails. The response contains the inbox's ID and its associated email address. It is recommended that you create a new inbox during each test method so that it is unique and empty ### Example ```ruby # 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::ExtraOperationsApi.new begin #Create an Inbox (email address) result = api_instance.create_inbox p result rescue MailSlurpClient::ApiError => e puts "Exception when calling ExtraOperationsApi->create_inbox: #{e}" end ``` ### Parameters This endpoint does not need any parameter. ### Return type [**Inbox**](Inbox.md) ### Authorization [API_KEY](../README.md#API_KEY) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json # **create_webhook** > Webhook 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 ```ruby # 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::ExtraOperationsApi.new inbox_id = 'inbox_id_example' # String | inboxId create_webhook_options = MailSlurpClient::CreateWebhookOptions.new # CreateWebhookOptions | options 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 ExtraOperationsApi->create_webhook: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **inbox_id** | [**String**](.md)| inboxId | **create_webhook_options** | [**CreateWebhookOptions**](CreateWebhookOptions.md)| options | ### Return type [**Webhook**](Webhook.md) ### Authorization [API_KEY](../README.md#API_KEY) ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json # **delete_email** > delete_email(email_id) Delete Email Deletes an email and removes it from the inbox ### Example ```ruby # 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::ExtraOperationsApi.new email_id = 'email_id_example' # String | emailId begin #Delete Email api_instance.delete_email(email_id) rescue MailSlurpClient::ApiError => e puts "Exception when calling ExtraOperationsApi->delete_email: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **email_id** | [**String**](.md)| emailId | ### Return type nil (empty response body) ### Authorization [API_KEY](../README.md#API_KEY) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: Not defined # **delete_inbox** > delete_inbox(inbox_id) Delete Inbox / Email Address Permanently delete an inbox and associated email address ### Example ```ruby # 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::ExtraOperationsApi.new inbox_id = 'inbox_id_example' # String | inboxId begin #Delete Inbox / Email Address api_instance.delete_inbox(inbox_id) rescue MailSlurpClient::ApiError => e puts "Exception when calling ExtraOperationsApi->delete_inbox: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **inbox_id** | [**String**](.md)| inboxId | ### Return type nil (empty response body) ### Authorization [API_KEY](../README.md#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 ```ruby # 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::ExtraOperationsApi.new inbox_id = 'inbox_id_example' # String | inboxId webhook_id = 'webhook_id_example' # String | webhookId 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 ExtraOperationsApi->delete_webhook: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **inbox_id** | [**String**](.md)| inboxId | **webhook_id** | [**String**](.md)| webhookId | ### Return type nil (empty response body) ### Authorization [API_KEY](../README.md#API_KEY) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: Not defined # **download_attachment** > download_attachment(attachment_id, email_id) Get email attachment Returns the specified attachment for a given email as a byte stream (file download). Get the attachmentId from the email response. Requires enterprise account. ### Example ```ruby # 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::ExtraOperationsApi.new attachment_id = 'attachment_id_example' # String | attachmentId email_id = 'email_id_example' # String | emailId begin #Get email attachment api_instance.download_attachment(attachment_id, email_id) rescue MailSlurpClient::ApiError => e puts "Exception when calling ExtraOperationsApi->download_attachment: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **attachment_id** | **String**| attachmentId | **email_id** | [**String**](.md)| emailId | ### Return type nil (empty response body) ### Authorization [API_KEY](../README.md#API_KEY) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: Not defined # **get_email** > Email get_email(email_id) Get Email Content Returns a email summary object with headers and content. To retrieve the raw unparsed email use the getRawMessage endpoint ### Example ```ruby # 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::ExtraOperationsApi.new email_id = 'email_id_example' # String | emailId begin #Get Email Content result = api_instance.get_email(email_id) p result rescue MailSlurpClient::ApiError => e puts "Exception when calling ExtraOperationsApi->get_email: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **email_id** | [**String**](.md)| emailId | ### Return type [**Email**](Email.md) ### Authorization [API_KEY](../README.md#API_KEY) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json # **get_emails** > Array<EmailPreview> get_emails(inbox_id, opts) List Emails in an Inbox / EmailAddress List emails that an inbox has received. Only emails that are sent to the inbox's email address will appear in the inbox. It may take several seconds for any email you send to an inbox's email address to appear in the inbox. To make this endpoint wait for a minimum number of emails use the `minCount` parameter. The server will retry the inbox database until the `minCount` is satisfied or the `retryTimeout` is reached ### Example ```ruby # 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::ExtraOperationsApi.new inbox_id = 'inbox_id_example' # String | Id of inbox that emails belongs to opts = { limit: 56, # Integer | Limit the result set, ordered by descending received date time min_count: 56, # Integer | Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached. retry_timeout: 56, # Integer | Maximum milliseconds to spend retrying inbox database until minCount emails are returned since: DateTime.parse('2013-10-20T19:20:30+01:00') # DateTime | Exclude emails received before this ISO 8601 date time } begin #List Emails in an Inbox / EmailAddress result = api_instance.get_emails(inbox_id, opts) p result rescue MailSlurpClient::ApiError => e puts "Exception when calling ExtraOperationsApi->get_emails: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **inbox_id** | [**String**](.md)| Id of inbox that emails belongs to | **limit** | **Integer**| Limit the result set, ordered by descending received date time | [optional] **min_count** | **Integer**| Minimum acceptable email count. Will cause request to hang (and retry) until minCount is satisfied or retryTimeout is reached. | [optional] **retry_timeout** | **Integer**| Maximum milliseconds to spend retrying inbox database until minCount emails are returned | [optional] **since** | **DateTime**| Exclude emails received before this ISO 8601 date time | [optional] ### Return type [**Array<EmailPreview>**](EmailPreview.md) ### Authorization [API_KEY](../README.md#API_KEY) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json # **get_inbox** > Inbox get_inbox(inbox_id) Get Inbox / EmailAddress Returns an inbox's properties, including its email address and ID. ### Example ```ruby # 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::ExtraOperationsApi.new inbox_id = 'inbox_id_example' # String | inboxId begin #Get Inbox / EmailAddress result = api_instance.get_inbox(inbox_id) p result rescue MailSlurpClient::ApiError => e puts "Exception when calling ExtraOperationsApi->get_inbox: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **inbox_id** | [**String**](.md)| inboxId | ### Return type [**Inbox**](Inbox.md) ### Authorization [API_KEY](../README.md#API_KEY) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json # **get_inboxes** > Array<Inbox> get_inboxes List Inboxes / Email Addresses List the inboxes you have created ### Example ```ruby # 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::ExtraOperationsApi.new begin #List Inboxes / Email Addresses result = api_instance.get_inboxes p result rescue MailSlurpClient::ApiError => e puts "Exception when calling ExtraOperationsApi->get_inboxes: #{e}" end ``` ### Parameters This endpoint does not need any parameter. ### Return type [**Array<Inbox>**](Inbox.md) ### Authorization [API_KEY](../README.md#API_KEY) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json # **get_raw_email_contents** > String get_raw_email_contents(email_id) Get Raw Email Content Returns a raw, unparsed and unprocessed email ### Example ```ruby # 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::ExtraOperationsApi.new email_id = 'email_id_example' # String | emailId begin #Get Raw Email Content result = api_instance.get_raw_email_contents(email_id) p result rescue MailSlurpClient::ApiError => e puts "Exception when calling ExtraOperationsApi->get_raw_email_contents: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **email_id** | [**String**](.md)| emailId | ### Return type **String** ### Authorization [API_KEY](../README.md#API_KEY) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json # **get_webhooks** > Array<Webhook> get_webhooks(inbox_id) Get all WebHooks for an Inbox ### Example ```ruby # 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::ExtraOperationsApi.new inbox_id = 'inbox_id_example' # String | inboxId begin #Get all WebHooks for an Inbox result = api_instance.get_webhooks(inbox_id) p result rescue MailSlurpClient::ApiError => e puts "Exception when calling ExtraOperationsApi->get_webhooks: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **inbox_id** | [**String**](.md)| inboxId | ### Return type [**Array<Webhook>**](Webhook.md) ### Authorization [API_KEY](../README.md#API_KEY) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json # **send_email** > send_email(inbox_id, send_email_options) Send Email Send an email from the inbox's email address. Specify the email recipients and contents in the request body. See the `SendEmailOptions` for more information. Note the `inboxId` refers to the inbox's id NOT its email address ### Example ```ruby # 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::ExtraOperationsApi.new inbox_id = 'inbox_id_example' # String | inboxId send_email_options = MailSlurpClient::SendEmailOptions.new # SendEmailOptions | sendEmailOptions begin #Send Email api_instance.send_email(inbox_id, send_email_options) rescue MailSlurpClient::ApiError => e puts "Exception when calling ExtraOperationsApi->send_email: #{e}" end ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **inbox_id** | [**String**](.md)| inboxId | **send_email_options** | [**SendEmailOptions**](SendEmailOptions.md)| sendEmailOptions | ### Return type nil (empty response body) ### Authorization [API_KEY](../README.md#API_KEY) ### HTTP request headers - **Content-Type**: application/json - **Accept**: Not defined