All URIs are relative to https://api.mailmojo.no
Method | HTTP request | Description |
---|---|---|
createAccount | POST /v1/accounts/ | Create an account. |
getAccountByUsername | GET /v1/accounts/{username}/ | Retrieve account details. |
getDomain | GET /v1/domains/{domain_id}/ | Retrieve domain details and authentication status. |
getDomains | GET /v1/domains/ | Retrieve a list of all domains and their status. |
updateAccount | POST /v1/accounts/{username}/ | Update account details. |
\MailMojo\MailMojo\Model\User createAccount($user)
Create an account.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: mailmojo_auth
$config = MailMojo\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new MailMojo\Api\AccountApi(
// 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
);
$user = new \MailMojo\MailMojo\Model\UserCreation(); // \MailMojo\MailMojo\Model\UserCreation |
try {
$result = $apiInstance->createAccount($user);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AccountApi->createAccount: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
user | \MailMojo\MailMojo\Model\UserCreation |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\MailMojo\MailMojo\Model\User getAccountByUsername($username)
Retrieve account details.
This endpoint can be used to get details about your own account, or a subuser associated with you as a partner. If the username of your current authenticated user is unknown, you may use the special username 'me' to retrieve details about the authenticated user account.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: mailmojo_auth
$config = MailMojo\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new MailMojo\Api\AccountApi(
// 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
);
$username = "username_example"; // string | Username of the account to get details for, or the special username `me` to get details about your authenticated user.
try {
$result = $apiInstance->getAccountByUsername($username);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AccountApi->getAccountByUsername: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
username | string | Username of the account to get details for, or the special username `me` to get details about your authenticated user. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\MailMojo\MailMojo\Model\Domain getDomain($domain_id)
Retrieve domain details and authentication status.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: mailmojo_auth
$config = MailMojo\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new MailMojo\Api\AccountApi(
// 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
);
$domain_id = new \stdClass; // object |
try {
$result = $apiInstance->getDomain($domain_id);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AccountApi->getDomain: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
domain_id | object |
\MailMojo\MailMojo\Model\Domain
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
object[] getDomains()
Retrieve a list of all domains and their status.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: mailmojo_auth
$config = MailMojo\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new MailMojo\Api\AccountApi(
// 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->getDomains();
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AccountApi->getDomains: ', $e->getMessage(), PHP_EOL;
}
?>
This endpoint does not need any parameter.
object[]
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
\MailMojo\MailMojo\Model\User updateAccount($username)
Update account details.
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure OAuth2 access token for authorization: mailmojo_auth
$config = MailMojo\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');
$apiInstance = new MailMojo\Api\AccountApi(
// 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
);
$username = "username_example"; // string | Username of the user to update.
try {
$result = $apiInstance->updateAccount($username);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling AccountApi->updateAccount: ', $e->getMessage(), PHP_EOL;
}
?>
Name | Type | Description | Notes |
---|---|---|---|
username | string | Username of the user to update. |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]