MailSlurp\DomainControllerApi
All URIs are relative to https://php.api.mailslurp.com, except if the operation defines another base path.
Method | HTTP request | Description |
---|---|---|
addDomainWildcardCatchAll() | POST /domains/{id}/wildcard | Add catch all wild card inbox to domain |
createDomain() | POST /domains | Create Domain |
deleteDomain() | DELETE /domains/{id} | Delete a domain |
getDomain() | GET /domains/{id} | Get a domain |
getDomains() | GET /domains | Get domains |
updateDomain() | PUT /domains/{id} | Update a domain |
addDomainWildcardCatchAll()
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
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new MailSlurpApiDomainControllerApi(
// If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
// This is optional, `GuzzleHttpClient` will be used as default.
new GuzzleHttpClient(),
$config
);
$id = 'id_example'; // string
try {
$result = $apiInstance->addDomainWildcardCatchAll($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DomainControllerApi->addDomainWildcardCatchAll: ', $e->getMessage(), PHP_EOL;
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | string |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to ]
createDomain()
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
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new MailSlurpApiDomainControllerApi(
// If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
// This is optional, `GuzzleHttpClient` will be used as default.
new GuzzleHttpClient(),
$config
);
$create_domain_options = new MailSlurpModelsCreateDomainOptions(); // MailSlurpModelsCreateDomainOptions
try {
$result = $apiInstance->createDomain($create_domain_options);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DomainControllerApi->createDomain: ', $e->getMessage(), PHP_EOL;
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
create_domain_options | MailSlurpModelsCreateDomainOptions |
Return type
Authorization
HTTP request headers
- Content-Type:
application/json
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to ]
deleteDomain()
Delete a domain
Delete a domain. This will disable any existing inboxes that use this domain.
Example
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new MailSlurpApiDomainControllerApi(
// If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
// This is optional, `GuzzleHttpClient` will be used as default.
new GuzzleHttpClient(),
$config
);
$id = 'id_example'; // string
try {
$result = $apiInstance->deleteDomain($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DomainControllerApi->deleteDomain: ', $e->getMessage(), PHP_EOL;
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | string |
Return type
string[]
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to ]
getDomain()
Get a domain
Returns domain verification status and tokens for a given domain
Example
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new MailSlurpApiDomainControllerApi(
// If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
// This is optional, `GuzzleHttpClient` will be used as default.
new GuzzleHttpClient(),
$config
);
$id = 'id_example'; // string
try {
$result = $apiInstance->getDomain($id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DomainControllerApi->getDomain: ', $e->getMessage(), PHP_EOL;
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | string |
Return type
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to ]
getDomains()
Get domains
List all custom domains you have created
Example
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new MailSlurpApiDomainControllerApi(
// If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
// This is optional, `GuzzleHttpClient` will be used as default.
new GuzzleHttpClient(),
$config
);
try {
$result = $apiInstance->getDomains();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DomainControllerApi->getDomains: ', $e->getMessage(), PHP_EOL;
}
Parameters
This endpoint does not need any parameter.
Return type
MailSlurpModelsDomainPreview[]
Authorization
HTTP request headers
- Content-Type: Not defined
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to ]
updateDomain()
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
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: API_KEY
$config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKey('x-api-key', 'YOUR_API_KEY');
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// $config = MailSlurpConfiguration::getDefaultConfiguration()->setApiKeyPrefix('x-api-key', 'Bearer');
$apiInstance = new MailSlurpApiDomainControllerApi(
// If you want use custom http client, pass your client which implements `GuzzleHttpClientInterface`.
// This is optional, `GuzzleHttpClient` will be used as default.
new GuzzleHttpClient(),
$config
);
$id = 'id_example'; // string
$update_domain_options = new MailSlurpModelsUpdateDomainOptions(); // MailSlurpModelsUpdateDomainOptions
try {
$result = $apiInstance->updateDomain($id, $update_domain_options);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling DomainControllerApi->updateDomain: ', $e->getMessage(), PHP_EOL;
}
Parameters
Name | Type | Description | Notes |
---|---|---|---|
id | string | ||
update_domain_options | MailSlurpModelsUpdateDomainOptions |
Return type
Authorization
HTTP request headers
- Content-Type:
application/json
- Accept:
*/*
[Back to top] [Back to API list] [Back to Model list] [Back to ]