MailSlurpClient::DomainControllerApi

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

MethodHTTP requestDescription
add_domain_wildcard_catch_allPOST /domains/{id}/wildcardAdd catch all wild card inbox to domain
create_domainPOST /domainsCreate Domain
delete_domainDELETE /domains/{id}Delete a domain
get_domainGET /domains/{id}Get a domain
get_domainsGET /domainsGet domains
update_domainPUT /domains/{id}Update a domain

add_domain_wildcard_catch_all

DomainDto add_domain_wildcard_catch_all(id)

Add catch all wild card inbox to domain

Add a catch all inbox to a domain so that any emails sent to it that cannot be matched will be sent to the catch all inbox generated

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::DomainControllerApi.new
id = 'id_example' # String | id

begin
  #Add catch all wild card inbox to domain
  result = api_instance.add_domain_wildcard_catch_all(id)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling DomainControllerApi->add_domain_wildcard_catch_all: #{e}"
end

Parameters

NameTypeDescriptionNotes
idStringid

Return type

DomainDto

Authorization

API_KEY

HTTP request headers

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

create_domain

DomainDto create_domain(domain_options)

Create Domain

Link a domain that you own with MailSlurp so you can create email addresses using it. Endpoint returns DNS records used for validation. You must add these verification records to your host provider’s DNS setup to verify the domain.

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::DomainControllerApi.new
domain_options = MailSlurpClient::CreateDomainOptions.new # CreateDomainOptions | domainOptions

begin
  #Create Domain
  result = api_instance.create_domain(domain_options)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling DomainControllerApi->create_domain: #{e}"
end

Parameters

NameTypeDescriptionNotes
domain_optionsCreateDomainOptionsdomainOptions

Return type

DomainDto

Authorization

API_KEY

HTTP request headers

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

delete_domain

Array delete_domain(id)

Delete a domain

Delete a domain. This will disable any existing inboxes that use this domain.

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::DomainControllerApi.new
id = 'id_example' # String | id

begin
  #Delete a domain
  result = api_instance.delete_domain(id)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling DomainControllerApi->delete_domain: #{e}"
end

Parameters

NameTypeDescriptionNotes
idStringid

Return type

Array

Authorization

API_KEY

HTTP request headers

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

get_domain

DomainDto get_domain(id)

Get a domain

Returns domain verification status and tokens for a given domain

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::DomainControllerApi.new
id = 'id_example' # String | id

begin
  #Get a domain
  result = api_instance.get_domain(id)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling DomainControllerApi->get_domain: #{e}"
end

Parameters

NameTypeDescriptionNotes
idStringid

Return type

DomainDto

Authorization

API_KEY

HTTP request headers

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

get_domains

Array get_domains

Get domains

List all custom domains you have created

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::DomainControllerApi.new

begin
  #Get domains
  result = api_instance.get_domains
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling DomainControllerApi->get_domains: #{e}"
end

Parameters

This endpoint does not need any parameter.

Return type

Array

Authorization

API_KEY

HTTP request headers

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

update_domain

DomainDto update_domain(id, update_domain_dto)

Update a domain

Update values on a domain. Note you cannot change the domain name as it is immutable. Recreate the domain if you need to alter this.

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::DomainControllerApi.new
id = 'id_example' # String | id
update_domain_dto = MailSlurpClient::UpdateDomainOptions.new # UpdateDomainOptions | updateDomainDto

begin
  #Update a domain
  result = api_instance.update_domain(id, update_domain_dto)
  p result
rescue MailSlurpClient::ApiError => e
  puts "Exception when calling DomainControllerApi->update_domain: #{e}"
end

Parameters

NameTypeDescriptionNotes
idStringid
update_domain_dtoUpdateDomainOptionsupdateDomainDto

Return type

DomainDto

Authorization

API_KEY

HTTP request headers

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