Connecting to the Dynect API via PHP / CodeIgniter
Go to file
Will Bradley 99b03ae4eb Merge pull request #1 from rupertj/master
Untested. Use with caution, or use previous commit until this merge is verified working.
2011-07-04 02:32:05 -07:00
system Improved error handling on the Dynect API class. 2011-06-28 16:58:25 +01:00
user_guide Initial commit 2010-12-31 01:05:08 -07:00
README.markdown 2011-02-04 11:02:58 -08:00
index.php Initial commit 2010-12-31 01:05:08 -07:00
license.txt Initial commit 2010-12-31 01:05:08 -07:00


CodeIgniter-Dynect API

Connecting to the Dynect API with CodeIgniter (PHP) This is an open-source work in progress, and your contribution is appreciated!

TODO: The Dynect API doesn't appear to support everything needed, but this is a decently-complete implementation and should get anyone trying to interface with Dynect via PHP a good head start. The code is very hackish -- there's a lot of copy-paste and the CodeIgniter section is just a repurposed welcome.php -- but the good news is that sections are quite usable on their own. There's no config files, dependencies, or a significant MVC to be concerned about, and so should be decent as PHP sample code of the Dynect API implementation.


  1. Copy system/application/libraries/Dynect_API.php to your CodeIgniter app's application/libraries folder (if applicable, otherwise just use the PHP file as-is.)
  2. Review the sample code in system/application/controllers/welcome.php for usage examples.
  3. Reference Dynect's API documentation for further information.


Ideally, there would be a config file in system/application/config but I haven't gotten it to work properly yet.

In the system/application/libraries/Dynect_API.php file, edit these lines as necessary based on info provided by Dynect:

var $user_name = '';
var $customer_name = '';
var $password = '';


First, load the library and instantiate the class.

$dyn = new Dynect_API();

Then, login. Make sure to logout at the end.

// do things

What you do is up to you. Here's what I've written so far:

print_r($dyn->create_zone("", "", 3600));
print_r($dyn->create_record('A', '', '', array('address' => '')));
print_r($dyn->delete_records('A', '', ''));