In an earlier post, I walked through an example project demonstrating how to use the Node.js module for SMSified. We’ve also demonstrated how to use the SMSified Ruby Gem.

In this post and accompanying screencast, I’m going to walk through a sample project that uses another of our language bindings for the SMSified API – the SMSified PHP library.

In this example, we’ll create a management system for storing inbound SMS messages using PHP and CouchDB. In addition to the SMSified PHP library, I make use of the excellent Sag PHP library for CouchDB.

The code for the PHP script I demonstrate in this screencast can be found on GitHub.

If you didn’t grok all of the CouchDB design document functions I showcased, you can get those from GtiHub as well.

But if you are running CouchDB locally, and want to quickly and easily acquire all of the functions I demonstrated, you can simply take advantage of CouchDB’s awesome replication feature.

Simply run the following at the command line to replicate a sample DB we’ve created on one of our hosted CouchDB instances that includes the design document I use in this screencast.

First, create a local ‘smsrecords’ database:

~$ curl -X PUT http://127.0.0.1:5984/smsrecords

Then replicate to the new local database:

~$ curl -X POST http://127.0.0.1:5984/_replicate \ -H 'Content-type: application/json' \ -d '{"source":"http://tropo.couchone.com/smsrecords", "target": "smsrecords"}'

Creating a permanent record for all of your text messages in a powerful data store like CouchDB couldn’t be easier.

Stay tuned for more PHP awesomeness from SMSified!

©2011 SMSified. All Rights Reserved.

.

Originally from All Voxeo Blogs Feed