SRSplus PHP API Class

SRSplus PHP API Class

Released 7 years ago , Last update 7 years ago

PHP Class for domain registration at Srsplus.com

Srsplus.com is one of leading domain name providers but they only offer C and Perl clients for their API. This class will enable you to communicate with their API from PHP.

Requirements

  • PHP5+ with CURL, GnuPG and SSL support
  • An Srsplus.com reseller account
  • Operating system with GnuPG installed, ability to generate public/private keys
  • (optionally) http://www.srsplus.com/devguide.pdf
  • (optionally) http://www.srsplus.com/apiperllinux.pdf
5.0
  • 5 1
  • 4 0
  • 3 0
  • 2 0
  • 1 0
1 Reviews Read Reviews

Pricing

14 day 14-day money-back guarantee

$20.99

Personal license

  • Perpetual license

  • 1 site, unlimited servers

  • No distribution (hosted use only)

  • Commercial use

Documentation

This text assumes you have system with PHP5+ (with Curl, Gnupg, SSL enabled), GnuPG installed and Srsplus.com reseller account active.

If you are missing GnuPG on your linux box you can read nice post on how to set it up here: http://ubuntuforums.org/showthread.php?t=680292

If you need to install GnuPG support on your existing PHP5 configuration look it up here: http://php.net/manual/en/gnupg.installation.php

First of all you will need to exchange keys with Srsplus.com, contact them and their staff will help you through this process. (you can see how gnupg works on above links) Once you have generated keys you will need to place them in folder on your server where you can access them from php/apache. Fill in path to GnuPG keys in $gnupgpath variable below. Once you get api access from srsplus.com they will provide you with the cacert.pem file. Again, copy that file in folder on your server and type in path to the file in $certificatepath variable. While generating keys for GnuPG you can enter email and passphrase (it's a 'password' for your keys) if you didn't leave it blank type in exact passphrase in $passphrase variable, email should be typed in $gnupgkeyemail variable.

Once you have setup GnuPG you can move on to typing in your Srsplus account details, fill them in in Srsplus.com section.

Variable $test_mode is used to change from production to development. 1 - test/development mode is on, 0 - production mode is on

Thats about it, look in example files to see how to register/renew... domains.

Examples

Get Whois

require_once('srs_api.class.php');
$domain_name = 'example-domain';
$domain_type = 'com';
$srs = new Srs_api();
$response = $srs->who_is($domain_name, $domain_type);
print $response;

Renew Domain

require_once('srs_api.class.php');
$domain_name = 'example-domain';
$domain_type = 'com';
$years = 1; // number of years we want to renew min: 1 max: 10
$srs = new Srs_api();

$response = $srs->renewDomain($domain_name, 
                                $domain_type, 
                                $years);

print_r($response);

Register Domain

require_once('srs_api.class.php');

$srs = new Srs_api();
$contact = array(
        'TLD'           => 'com',
        'FNAME'         => 'John',
        'LNAME'         => 'Smit',
        'ORGANIZATION'  => 'ACME LTD',
        'EMAIL'         => 'john.smit@acme.com',
        'ADDRESS1'      => 'Big streed 1/23',
        'ADDRESS2'      => '',
        'CITY'          => 'Big City',
        'PROVINCE'      => '',
        'COUNTRY'       => 'US',
        'PHONE'         => '5555551212 ',
        'POSTAL CODE'   => '11000',
);
$tech_contactid = $srs->createContact($contact);

$contact = array(
        'TLD'           => 'com',
        'FNAME'         => 'Ben',
        'LNAME'         => 'Smit',
        'ORGANIZATION'  => 'ACME LTD',
        'EMAIL'         => 'ben.smit@acme.com',
        'ADDRESS1'      => 'Big streed 1/23',
        'ADDRESS2'      => '',
        'CITY'          => 'Big City',
        'PROVINCE'      => '',
        'COUNTRY'       => 'US',
        'PHONE'         => '5555551212 ',
        'POSTAL CODE'   => '11000',
);
$admin_contactid = $srs->createContact($contact);

$domain_name = 'example-domain';
$domain_type = 'com';
$years = 1; // number of years we want to register min: 1 max: 10
$dns_servers = Array('dns1.domain.com', 'dns2.domain.com', 'dns3.domain.com'); //minimum 2

$response = $srs->registerDomain($domain_name, 
                                 $domain_type, 
                                 $years, 
                                 $admin_contactid, 
                                 $tech_contactid, 
                                 $dns_servers);

print_r($response);
1 license From » $20.99 View Licenses

Get A Quote

What do you need?
  • Custom development
  • Integration
  • Customization / Reskinning
  • Consultation
When do you need it?
  • Soon
  • Next week
  • Next month
  • Anytime

Thanks for getting in touch!

Your quote details have been received and we'll get back to you soon.


Or enter your name and Email
  • CY Christopher York 6 years ago
    Will this work for Windows as well?
  • SK Sohail Khan 6 years ago
    Hi My client purchse this api and i am going to integrate it, i have install the GNUPG and now trying to use this PHP API, but i have some problems in calling the simple whois request. where is the cacert.pem file, the srsplus is not providing such files, please help me in integration. THanks