All URIs are relative to https://box.example.com/admin
Method | HTTP request | Description |
---|---|---|
addMailUser | POST /mail/users/add | Add mail user |
addMailUserPrivilege | POST /mail/users/privileges/add | Add mail user privilege |
getMailAliases | GET /mail/aliases | Get mail aliases |
getMailDomains | GET /mail/domains | Get mail domains |
getMailUserPrivileges | GET /mail/users/privileges | Get mail user privileges |
getMailUsers | GET /mail/users | Get mail users |
removeMailAlias | POST /mail/aliases/remove | Remove mail alias |
removeMailUser | POST /mail/users/remove | Remove mail user |
removeMailUserPrivilege | POST /mail/users/privileges/remove | Remove mail user privilege |
setMailUserPassword | POST /mail/users/password | Set mail user password |
upsertMailAlias | POST /mail/aliases/add | Upsert mail alias |
string addMailUser($email, $password, $privileges)
Add mail user
Adds a new mail user.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
$config = MailInABoxAPI\Client\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MailInABoxAPI\Client\Api\MailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$email = 'email_example'; // string | Email format.
$password = 'password_example'; // string |
$privileges = new \MailInABoxAPI\Client\Model\MailUserPrivilege(); // \MailInABoxAPI\Client\Model\MailUserPrivilege |
try {
$result = $apiInstance->addMailUser($email, $password, $privileges);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MailApi->addMailUser: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
string | Email format. | ||
password | string | ||
privileges | \MailInABoxAPI\Client\Model\MailUserPrivilege |
string
- Content-Type: application/x-www-form-urlencoded
- Accept: text/html
[Back to top] [Back to API list] [Back to Model list] [Back to README]
string addMailUserPrivilege($email, $privilege)
Add mail user privilege
Adds a privilege to an existing mail user.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
$config = MailInABoxAPI\Client\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MailInABoxAPI\Client\Api\MailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$email = 'email_example'; // string | Email format.
$privilege = new \MailInABoxAPI\Client\Model\MailUserPrivilege(); // \MailInABoxAPI\Client\Model\MailUserPrivilege |
try {
$result = $apiInstance->addMailUserPrivilege($email, $privilege);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MailApi->addMailUserPrivilege: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
string | Email format. | ||
privilege | \MailInABoxAPI\Client\Model\MailUserPrivilege |
string
- Content-Type: application/x-www-form-urlencoded
- Accept: text/html
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\MailInABoxAPI\Client\Model\MailAliasByDomain[] getMailAliases($format)
Get mail aliases
Returns all mail aliases.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
$config = MailInABoxAPI\Client\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MailInABoxAPI\Client\Api\MailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$format = new \MailInABoxAPI\Client\Model\\MailInABoxAPI\Client\Model\MailAliasesResponseFormat(); // \MailInABoxAPI\Client\Model\MailAliasesResponseFormat | The format of the response.
try {
$result = $apiInstance->getMailAliases($format);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MailApi->getMailAliases: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
format | \MailInABoxAPI\Client\Model\MailAliasesResponseFormat | The format of the response. | [optional] |
\MailInABoxAPI\Client\Model\MailAliasByDomain[]
- Content-Type: Not defined
- Accept: application/json, text/html
[Back to top] [Back to API list] [Back to Model list] [Back to README]
string getMailDomains()
Get mail domains
Returns all mail domains.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
$config = MailInABoxAPI\Client\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MailInABoxAPI\Client\Api\MailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
try {
$result = $apiInstance->getMailDomains();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MailApi->getMailDomains: ', $e->getMessage(), PHP_EOL;
}
?>
This endpoint does not need any parameter.
string
- Content-Type: Not defined
- Accept: text/html
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\MailInABoxAPI\Client\Model\MailUserPrivilege getMailUserPrivileges($email)
Get mail user privileges
Returns all privileges for an existing mail user.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
$config = MailInABoxAPI\Client\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MailInABoxAPI\Client\Api\MailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$email = 'email_example'; // string | The email you want to get privileges for.
try {
$result = $apiInstance->getMailUserPrivileges($email);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MailApi->getMailUserPrivileges: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
string | The email you want to get privileges for. | [optional] |
\MailInABoxAPI\Client\Model\MailUserPrivilege
- Content-Type: Not defined
- Accept: text/html
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\MailInABoxAPI\Client\Model\MailUsersResponse getMailUsers($format)
Get mail users
Returns all mail users.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
$config = MailInABoxAPI\Client\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MailInABoxAPI\Client\Api\MailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$format = new \MailInABoxAPI\Client\Model\\MailInABoxAPI\Client\Model\MailUsersResponseFormat(); // \MailInABoxAPI\Client\Model\MailUsersResponseFormat | The format of the response.
try {
$result = $apiInstance->getMailUsers($format);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MailApi->getMailUsers: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
format | \MailInABoxAPI\Client\Model\MailUsersResponseFormat | The format of the response. | [optional] |
\MailInABoxAPI\Client\Model\MailUsersResponse
- Content-Type: Not defined
- Accept: application/json, text/html
[Back to top] [Back to API list] [Back to Model list] [Back to README]
string removeMailAlias($address)
Remove mail alias
Removes a mail alias.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
$config = MailInABoxAPI\Client\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MailInABoxAPI\Client\Api\MailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$address = 'address_example'; // string | Email format.
try {
$result = $apiInstance->removeMailAlias($address);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MailApi->removeMailAlias: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
address | string | Email format. |
string
- Content-Type: application/x-www-form-urlencoded
- Accept: text/html
[Back to top] [Back to API list] [Back to Model list] [Back to README]
string removeMailUser($email)
Remove mail user
Removes an existing mail user.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
$config = MailInABoxAPI\Client\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MailInABoxAPI\Client\Api\MailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$email = 'email_example'; // string | Email format.
try {
$result = $apiInstance->removeMailUser($email);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MailApi->removeMailUser: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
string | Email format. |
string
- Content-Type: application/x-www-form-urlencoded
- Accept: text/html
[Back to top] [Back to API list] [Back to Model list] [Back to README]
string removeMailUserPrivilege($email, $privilege)
Remove mail user privilege
Removes a privilege from an existing mail user.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
$config = MailInABoxAPI\Client\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MailInABoxAPI\Client\Api\MailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$email = 'email_example'; // string | Email format.
$privilege = new \MailInABoxAPI\Client\Model\MailUserPrivilege(); // \MailInABoxAPI\Client\Model\MailUserPrivilege |
try {
$result = $apiInstance->removeMailUserPrivilege($email, $privilege);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MailApi->removeMailUserPrivilege: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
string | Email format. | ||
privilege | \MailInABoxAPI\Client\Model\MailUserPrivilege |
string
- Content-Type: application/x-www-form-urlencoded
- Accept: text/html
[Back to top] [Back to API list] [Back to Model list] [Back to README]
string setMailUserPassword($email, $password)
Set mail user password
Sets a password for an existing mail user.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
$config = MailInABoxAPI\Client\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MailInABoxAPI\Client\Api\MailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$email = 'email_example'; // string | Email format.
$password = 'password_example'; // string |
try {
$result = $apiInstance->setMailUserPassword($email, $password);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MailApi->setMailUserPassword: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
string | Email format. | ||
password | string |
string
- Content-Type: application/x-www-form-urlencoded
- Accept: text/html
[Back to top] [Back to API list] [Back to Model list] [Back to README]
string upsertMailAlias($updateIfExists, $address, $forwardsTo, $permittedSenders)
Upsert mail alias
Adds or updates a mail alias. If updating, you need to set update_if_exists: 1
.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
$config = MailInABoxAPI\Client\Configuration::getDefaultConfiguration()
->setUsername('YOUR_USERNAME')
->setPassword('YOUR_PASSWORD');
$apiInstance = new MailInABoxAPI\Client\Api\MailApi(
// If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
// This is optional, `GuzzleHttp\Client` will be used as default.
new GuzzleHttp\Client(),
$config
);
$updateIfExists = 56; // int | Set to `1` when updating an alias.
$address = 'address_example'; // string | Email format.
$forwardsTo = 'forwardsTo_example'; // string | If adding a regular or catch-all alias, the format needs to be `[email protected]`. Multiple address can be separated by newlines or commas. If adding a domain alias, the format needs to be `@example.com`.
$permittedSenders = 'permittedSenders_example'; // string | Mail users that can send mail claiming to be from any address on the alias domain. Multiple address can be separated by newlines or commas. Leave empty to allow any mail user listed in `forwards_to` to send mail claiming to be from any address on the alias domain.
try {
$result = $apiInstance->upsertMailAlias($updateIfExists, $address, $forwardsTo, $permittedSenders);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling MailApi->upsertMailAlias: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
updateIfExists | int | Set to `1` when updating an alias. | |
address | string | Email format. | |
forwardsTo | string | If adding a regular or catch-all alias, the format needs to be `[email protected]`. Multiple address can be separated by newlines or commas. If adding a domain alias, the format needs to be `@example.com`. | |
permittedSenders | string | Mail users that can send mail claiming to be from any address on the alias domain. Multiple address can be separated by newlines or commas. Leave empty to allow any mail user listed in `forwards_to` to send mail claiming to be from any address on the alias domain. |
string
- Content-Type: application/x-www-form-urlencoded
- Accept: text/html
[Back to top] [Back to API list] [Back to Model list] [Back to README]