2017 © Pedro Peláez
 

library godaddy-api-client

Api client for GoDaddy Domains

image

gellu/godaddy-api-client

Api client for GoDaddy Domains

  • Monday, February 5, 2018
  • by gellu
  • Repository
  • 1 Watchers
  • 15 Stars
  • 3,878 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 8 Forks
  • 2 Open issues
  • 4 Versions
  • 13 % Grown

The README.md

GoDaddy Domains API Client

API client for GoDaddy Domains, (*1)

Requirements

PHP 5.4.0 and later, (*2)

Installation & Usage

Composer

To install the bindings via Composer, add the following to composer.json:, (*3)

{
  "require" : {
    "gellu/godaddy-api-client" : "1.*"
  }
}

Then run composer install, (*4)

Example - Domain purchase

<?php

const API_KEY       = ''; // key obtained from https://developer.godaddy.com
const API_SECRET    = ''; // secret obtained from https://developer.godaddy.com

$domain             = 'test-domain.com';
$domainPeriod       = 1;
$domainAutoRenew    = false;
$domainTLD          = 'pl';
$contact            = [
    'name'          => 'John',
    'surname'       => 'Doe',
    'email'         => 'john.doe@test-domain.com',
    'phone'         => '+48.111111111',
    'organization'  => 'Corporation Inc.',
    'street'        => 'Street Ave. 666',
    'city'          => 'New City',
    'country'       => 'PL',
    'postal-code'   => '11-111',
    'state'         => 'state of art'
];

$configuration = new \GoDaddyDomainsClient\Configuration();
$configuration->addDefaultHeader("Authorization", "sso-key ". API_KEY .":". API_SECRET);
$configuration->setDebug(true);

$apiClient = new \GoDaddyDomainsClient\ApiClient($configuration);
$apiInstance = new \GoDaddyDomainsClient\Api\VdomainsApi($apiClient);

$agreement = $apiInstance->getAgreement($domainTLD, false);
$agreementKeys = [$agreement[0]->getAgreementKey()];

$domainPurchase = new \GoDaddyDomainsClient\Model\DomainPurchase();
$domainPurchase->setDomain($domain);

$domainPurchaseConsent = new \GoDaddyDomainsClient\Model\Consent();
$domainPurchaseConsent->setAgreementKeys($agreementKeys);
$domainPurchaseConsent->setAgreedBy($contact['name'] . ' ' . $contact['surname']);
$domainPurchaseConsent->setAgreedAt(date("Y-m-d\TH:i:s\Z"));
$domainPurchase->setConsent($domainPurchaseConsent);

$domainContactAdmin = new \GoDaddyDomainsClient\Model\Contact();
$domainContactAdmin->setNameFirst($contact['name']);
$domainContactAdmin->setNameLast($contact['surname']);
$domainContactAdmin->setEmail($contact['email']);
$domainContactAdmin->setPhone($contact['phone']);
$domainContactAdmin->setOrganization($contact['organization']);

$domainContactAdminAddressMailing = new \GoDaddyDomainsClient\Model\Address();
$domainContactAdminAddressMailing->setAddress1($contact['street']);
$domainContactAdminAddressMailing->setCity($contact['city']);
$domainContactAdminAddressMailing->setCountry($contact['country']);
$domainContactAdminAddressMailing->setPostalCode($contact['postal-code']);
$domainContactAdminAddressMailing->setState($contact['state']);

$domainContactAdmin->setAddressMailing($domainContactAdminAddressMailing);

$domainPurchase->setContactAdmin($domainContactAdmin);
$domainPurchase->setContactBilling($domainContactAdmin);
$domainPurchase->setContactRegistrant($domainContactAdmin);
$domainPurchase->setContactTech($domainContactAdmin);
$domainPurchase->setPeriod($domainPeriod);
$domainPurchase->setRenewAuto($domainAutoRenew);

$purchase = $apiInstance->purchase($domainPurchase);

Documentation For Models

This PHP package is automatically generated by the Swagger Codegen project:, (*5)

  • API version: 2.4.8
  • Build date: 2016-09-01T15:18:33.475Z
  • Build package: class io.swagger.codegen.languages.PhpClientCodegen

The Versions

05/02 2018

dev-master

9999999-dev

Api client for GoDaddy Domains

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

by Grzegorz Krysiak (gellu)

api php sdk godaddy

26/10 2017

1.1.1

1.1.1.0

Api client for GoDaddy Domains

  Sources   Download

MIT

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

by Grzegorz Krysiak (gellu)

api php sdk godaddy

12/09 2016

1.1

1.1.0.0

Api client for GoDaddy Domains

  Sources   Download

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

by Grzegorz Krysiak (gellu)

api php sdk godaddy

12/09 2016

1.0

1.0.0.0

Api client for GoDaddy Domains

  Sources   Download

The Requires

  • php >=5.4
  • ext-curl *
  • ext-json *
  • ext-mbstring *

 

by Grzegorz Krysiak (gellu)

api php sdk godaddy