Important facts about commercial licenses

  • Licenses are perpetual. They do not expire and do not need to be renewed.
  • Licenses can be upgraded. You can upgrade to a more expensive license later paying only the difference in cost.
  • Pay attention to the distribution type - Hosted (sites / servers), binary (applications) or source (includes all the others). Choose according to your needs (more below).
  • All licenses allow commercial use unless otherwise indicated.
  • Read the full license by clicking on the icon.
  • Read more about licenses in our handy license guide.
$20

Personal license

1 site, unlimited servers No source distribution
You need to log-in or create an account
  • Create an account
  • Log-in
  • Please use your real name.
  • Account activation link will be sent to this address.
  • Minimum 8 characters

Clicking this button confirms you read and agreed to the terms of use and privacy policy.

  • Released: Apr 14, 2011
    Last Update: Apr 14, 2011
  • Language: PHP
  • Time / costs savings: 30h / $1800 *
(1 ratings)

SRSplus PHP API Class

SRSplus PHP API Class
Developed by Vladimir Cvetic, Released Apr 14, 2011

PHP Class for domain registration at Srsplus.com

PHP

Tags: api , curl , domain , domain name

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/api_perl_linux.pdf
Back to top

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 $gnupg_path 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 $certificate_path 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 $gnupg_key_email 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.

Back to top

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);
View all 1 reviews »

User Reviews

  • 1 of 1 people found this review helpful Roman Buzinov 1 year ago
    Great component!
    Flag
    Was this helpful? Yes No
Read all 4 comments »

Questions & Comments


Or enter your name and Email
  • Christopher York 2 years ago
    Will this work for Windows as well?
  • Sohail Khan 2 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
You must be logged-in to vote. Log-in to your account or register now.