2017 © Pedro PelĂĄez
 

library reseller-club

A PHP SDK for the ResellerClub API.

image

pitchero/reseller-club

A PHP SDK for the ResellerClub API.

  • Friday, January 19, 2018
  • by martinbean
  • Repository
  • 7 Watchers
  • 2 Stars
  • 85 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 3 Open issues
  • 17 Versions
  • 12 % Grown

The README.md

ResellerClub

Build Status, (*1)

A PHP SDK for ResellerClub’s API., (*2)

Requirements

  • PHP >= 7.0

Installation

This package is available through Packagist. To install in your project via [Composer][5]:, (*3)

$ composer require pitchero/reseller-club

Example Usages

Business Emails

API Documentation., (*4)

Creating a order

API Documentation, (*5)

try {
    $api = new ResellerClub\Api(
         new ResellerClub\Config(123, 'api_key', true),
         new GuzzleHttp\Client()
    )

    $request = new ResellerClub\Orders\BusinessEmails\Requests\BusinessEmailOrderRequest(
        $customerId = 123,
        $domain = 'some-domain.co.uk',
        $numberOfAccount = 5,
        $forNumberOfMonths = 1,
        ResellerClub\Orders\InvoiceOption::noInvoice()
    );    

    $response = $api->businessEmailOrder()->create($request);

    // @todo - Handle a successful response within your codebase.

} catch(ResellerClub\Exceptions\ApiException $e) {
    // @todo - Handle the exception within your codebase.
}

Deleting an order

API Documentation, (*6)

try {
    $api = new ResellerClub\Api(
         new ResellerClub\Config(123, 'api_key', true),
         new GuzzleHttp\Client()
    );

    $request = new ResellerClub\Orders\Order(
        $orderId = 123
    );

    $response = $api->businessEmailOrder()->delete($request);

    // @todo - Handle the successful response within your codebase.

} catch(ResellerClub\Exceptions\ApiException $e) {
    // @todo - Handle the exception within your codebase.
}

Getting an order

API Documentation, (*7)

try {
    $api = new ResellerClub\Api(
         new ResellerClub\Config(123, 'api_key', true),
         new GuzzleHttp\Client()
    );

    $request = new ResellerClub\Orders\Order(
        $orderId = 123
    );   

    $response = $api->businessEmailOrder()->get($request);

    // @todo - Handle the successful response within your codebase.

} catch(ResellerClub\Exceptions\ApiException $e) {
    // @todo - Handle the exception within your codebase.
}

Renewing an order

API Documentation, (*8)

try {
    $api = new ResellerClub\Api(
         new ResellerClub\Config(123, 'api_key', true),
         new GuzzleHttp\Client()
    );

    $request = new ResellerClub\Orders\BusinessEmails\Requests\RenewRequest(
        new ResellerClub\Orders\Order(
           $orderId = 123
        ),
        $months = 1,
        $numberOfAccounts = 1,
        ResellerClub\Orders\InvoiceOption::noInvoice()
    );

    $response = $api->businessEmailOrder()->renew($request);

    // @todo - Handle the successful response within your codebase.

} catch(ResellerClub\Exceptions\ApiException $e) {
    // @todo - Handle the exception within your codebase.
}

Add email account to a business email order

API Documentation, (*9)

try {
    $api = new ResellerClub\Api(
         new ResellerClub\Config(123, 'api_key', true),
         new GuzzleHttp\Client()
    );

    $request = new ResellerClub\Orders\BusinessEmails\Requests\AddEmailAccountRequest(
        new ResellerClub\Orders\Order(
           $orderId = 123
        ),
        $numberOfAccounts = 1,
        ResellerClub\Orders\InvoiceOption::noInvoice()
    );

    $response = $api->businessEmailOrder()->addEmailAccounts($request);

    // @todo - Handle the successful response within your codebase.

} catch(ResellerClub\Exceptions\ApiException $e) {
    // @todo - Handle the exception within your codebase.
}

Delete email account from an existing business email order

API Documentation, (*10)

try {
    $api = new ResellerClub\Api(
         new ResellerClub\Config(123, 'api_key', true),
         new GuzzleHttp\Client()
    );

    $request = new ResellerClub\Orders\BusinessEmails\Requests\DeleteEmailAccountRequest(
        new ResellerClub\Orders\Order(
           $orderId = 123
        ),
        $numberOfAccounts = 1
    );

    $response = $api->businessEmailOrder()->deleteEmailAccounts($request);

    // @todo - Handle the successful response within your codebase.

} catch(ResellerClub\Exceptions\ApiException $e) {
    // @todo - Handle the exception within your codebase.
}

Email Accounts

API Documentation., (*11)

Creating an email account

API Documentation, (*12)

try {
        $api = new ResellerClub\Api(
             new ResellerClub\Config(123, 'api_key', true),
             new GuzzleHttp\Client()
        );

        $request = ResellerClub\Orders\EmailAccounts\Requests\CreateRequest(
            ResellerClub\Orders\Order(
               $orderId = 123
            ),
            ResellerClub\EmailAddress(
               $email = 'john.doe@some-domain.co.uk'
            ),
            string $password,
            ResellerClub\EmailAddress(
               $notificationsEmail = 'john.doe@backup-email.co.uk'
            ),
            $firstName = 'John',
            $lastName = 'Doe',
            $countryCode = 'UK',
            $languageCode = 'en'
        );

        $response = $api->emailAccount()->create($request);

        // @todo - Handle the successful response within your codebase.

} catch(ResellerClub\Exceptions\ApiException $e) {
    // @todo - Handle the exception within your codebase.
}

Deleting an email account

API Documentation, (*13)

try {
        $api = new ResellerClub\Api(
             new ResellerClub\Config(123, 'api_key', true),
             new GuzzleHttp\Client()
        );

        $request = ResellerClub\Orders\EmailAccounts\Requests\DeleteRequest(
            ResellerClub\Orders\Order(
                $orderId = 123
            ),   
            ResellerClub\EmailAddress(
                $email = 'john.doe@some-domain.co.uk'
            )                     
        );

        $response = $api->emailAccount()->delete($request);

        // @todo - Handle the successful response within your codebase.

} catch(ResellerClub\Exceptions\ApiException $e) {
    // @todo - Handle the exception within your codebase.
}

Email forwarders

Create an email forwarder

API Documentation, (*14)

try {
        $api = new ResellerClub\Api(
             new ResellerClub\Config(123, 'api_key', true),
             new GuzzleHttp\Client()
        );

        $request = ResellerClub\Orders\EmailForwarders\Requests\CreateRequest(
              ResellerClub\Orders\Order(
                 $orderId = 123
              ),   
              ResellerClub\EmailAddress(
                $email = 'john.doe@some-domain.co.uk'
              )                   
        );

        $response = $api->emailForwarder()->create($request);

        // @todo - Handle the successful response within your codebase.

} catch(ResellerClub\Exceptions\ApiException $e) {
    // @todo - Handle the exception within your codebase.
}

Deleting an email forwarder

API Documentation, (*15)

try {
        $api = new ResellerClub\Api(
             new ResellerClub\Config(123, 'api_key', true),
             new GuzzleHttp\Client()
        );

        $request = ResellerClub\Orders\EmailAccounts\Requests\DeleteRequest(
            ResellerClub\Orders\Order(
                $orderId = 123
            ),   
            ResellerClub\EmailAddress(
                $email = 'john.doe@some-domain.co.uk'
            )                      
        );

        $response = $api->emailForwarder()->delete($request);

        // @todo - Handle the successful response within your codebase.

} catch(ResellerClub\Exceptions\ApiException $e) {
    // @todo - Handle the exception within your codebase.
}

Helpful articles from the ResellerClub knowledge base

  1. How to create an account on the staging platform
  2. Where to find and regenerate an API key

Add an A record

API Documentation, (*16)

try {
    $ttl = new ResellerClub\TimeToLive(86400);
    $request = new ResellerClub\Dns\A\Requests\AddRequest(
        $domain = 'another-testing-domain.com',
        $record = 'test',
        new ResellerClub\IPv4Address('127.0.0.1'),
        $ttl
    );

    $response = $api->aRecord()->add($request);

    // @todo - Handle the successful response within your codebase.

} catch(ResellerClub\Exceptions\ApiException $e) {
    // @todo - Handle the exception within your codebase.
}

Update a CNAME record

API Documentation, (*17)

try {
    $ttl = new ResellerClub\TimeToLive(86400);
    $request = new ResellerClub\Dns\Cname\Requests\UpdateRequest(
        $domain = 'your.com',
        $record = 'www',
        $currentValue = 'cname.oldservice.com',
        $newValue = 'cname.newservice.com',
        $ttl
    );

    $response = $api->cnameRecord()->update($request);

    // @todo - Handle the successful response within your codebase.

} catch(ResellerClub\Exceptions\ApiException $e) {
    // @todo - Handle the exception within your codebase.
}

License

Licensed under the MIT License., (*18)

Issues

If you find an issue with this package, please open a GitHub Issue., (*19)

The Versions

19/01 2018

dev-master

9999999-dev

A PHP SDK for the ResellerClub API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Rosebury

api email hosting reseller-club resellerclub

19/01 2018

1.3.1

1.3.1.0

A PHP SDK for the ResellerClub API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Rosebury

api email hosting reseller-club resellerclub

19/01 2018

dev-hot-fix/delete-email-accounts-endpoint-url

dev-hot-fix/delete-email-accounts-endpoint-url

A PHP SDK for the ResellerClub API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Rosebury

api email hosting reseller-club resellerclub

17/01 2018

1.3.0

1.3.0.0

A PHP SDK for the ResellerClub API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Rosebury

api email hosting reseller-club resellerclub

05/01 2018

1.2.0

1.2.0.0

A PHP SDK for the ResellerClub API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Rosebury

api email hosting reseller-club resellerclub

28/12 2017

1.1.4

1.1.4.0

A PHP SDK for the ResellerClub API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Rosebury

api email hosting reseller-club resellerclub

15/12 2017

1.1.3

1.1.3.0

A PHP SDK for the ResellerClub API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Rosebury

api email hosting reseller-club resellerclub

15/12 2017

1.1.2

1.1.2.0

A PHP SDK for the ResellerClub API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Rosebury

api email hosting reseller-club resellerclub

13/12 2017

1.1.1

1.1.1.0

A PHP SDK for the ResellerClub API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Rosebury

api email hosting reseller-club resellerclub

12/12 2017

1.1.0

1.1.0.0

A PHP SDK for the ResellerClub API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Rosebury

api email hosting reseller-club resellerclub

30/11 2017

1.0.6

1.0.6.0

A PHP SDK for the ResellerClub API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Rosebury

api email hosting reseller-club resellerclub

28/11 2017

1.0.5

1.0.5.0

A PHP SDK for the ResellerClub API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Rosebury

api email hosting reseller-club resellerclub

28/11 2017

1.0.4

1.0.4.0

A PHP SDK for the ResellerClub API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Rosebury

api email hosting reseller-club resellerclub

24/11 2017

1.0.3

1.0.3.0

A PHP SDK for the ResellerClub API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Rosebury

api email hosting reseller-club resellerclub

24/11 2017

1.0.2

1.0.2.0

A PHP SDK for the ResellerClub API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Rosebury

api email hosting reseller-club resellerclub

14/11 2017

1.0.1

1.0.1.0

A PHP SDK for the ResellerClub API.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Robert Rosebury

api email hosting reseller-club resellerclub

14/11 2017

1.0.0

1.0.0.0

A PHP SDK for the ResellerClub API.

  Sources   Download

The Requires

 

The Development Requires

by Robert Rosebury

api email hosting reseller-club resellerclub