Skip to content

Latest commit

 

History

History
266 lines (187 loc) · 8.24 KB

AccountApi.md

File metadata and controls

266 lines (187 loc) · 8.24 KB

MailMojo\AccountApi

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.

createAccount

\MailMojo\MailMojo\Model\User createAccount($user)

Create an account.

Example

<?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;
}
?>

Parameters

Name Type Description Notes
user \MailMojo\MailMojo\Model\UserCreation

Return type

\MailMojo\MailMojo\Model\User

Authorization

mailmojo_auth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getAccountByUsername

\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.

Example

<?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;
}
?>

Parameters

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.

Return type

\MailMojo\MailMojo\Model\User

Authorization

mailmojo_auth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getDomain

\MailMojo\MailMojo\Model\Domain getDomain($domain_id)

Retrieve domain details and authentication status.

Example

<?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;
}
?>

Parameters

Name Type Description Notes
domain_id object

Return type

\MailMojo\MailMojo\Model\Domain

Authorization

mailmojo_auth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getDomains

object[] getDomains()

Retrieve a list of all domains and their status.

Example

<?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;
}
?>

Parameters

This endpoint does not need any parameter.

Return type

object[]

Authorization

mailmojo_auth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]

updateAccount

\MailMojo\MailMojo\Model\User updateAccount($username)

Update account details.

Example

<?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;
}
?>

Parameters

Name Type Description Notes
username string Username of the user to update.

Return type

\MailMojo\MailMojo\Model\User

Authorization

mailmojo_auth

HTTP request headers

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

[Back to top] [Back to API list] [Back to Model list] [Back to README]