News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Nessa's Blog:
Simple API Writing, Part I
February 11, 2009 @ 12:08:11

Nessa has started off a series looking at writing your own API with part one posted recently focusing on the client-side first, writing an interface for their API.

Though in real applications you wouldn't need an API, all you'd need is a PHP script that accepts GET or POST input to perform some kind of action. In this example, we'll have a script that automatically adds DNS zones to a nameserver that runs cPanel as well. Most APIs do the same thing - you have a script, then that script accepts post/get variables, then does something.

Her example creates the request - a server, path, IP and hash key - and sends it off to the remote system. The result is pulled back in and parsed through a SimpleXML object. The credentials allow for access lists and a bit of security on the backend.

0 comments voice your opinion now!
api interface client use remote system hash ip simplexml cpanel


blog comments powered by Disqus

Similar Posts

Lars Tesmer's Blog: How to Unit Test a Class Making Calls to an URL (or the Filesystem) With PHPUnit

PHPBuilder.com: Talking to Facebook's Social Graph with PHP

PHPRiot.com: Translating Text Using the Google Translate API and PHP, JSON and cURL

Hari KT: Zend Feed and Guzzle

PHPit.net: Building an advertising system with PHP (Part 1)


Community Events

Don't see your event here?
Let us know!


podcast example performance opinion api introduction conference part2 laravel series php7 symfony2 interview language framework release install community configure application

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework