Web services allows the sharing of your website content across different websites accessed from different platforms. For example, let’s say you have a simple message board and you want the users to be able to show the information on their own site or update it via a mobile app and you do not have the money or time to have the app developed. As long as your site provides some means of interaction without actually being on your site itself, this is possible. This is how Twitter spread so fast. It made connecting to it available through different websites and applications such as Hootsuite and Tweet Deck. The Twitter API you keep hearing about is an example of web services at work.
Social Media has brought web services to the forefront. Through web services, social media has changed not only the way we communicate but the very nature of how we interact and think as a society. Sharing, discussing and collaboration are terms being redefined by the 21st century. Let’s say I find a great article, video, song, or better yet, let’s pretend I caught footage of bigfoot break dancing on camera and I wanted the entire world to see it! Well I would probably start by uploading my video to YouTube and then from there, I’d probably be wanting to share the link with my followers on Twitter and my friends on Facebook. I would want all the diggers to Digg it up and resubmit the link to their friends and other social networks. Updating 10+ social networks though would take a lot of my valuable time so I visit one of the many apps that allow me to submit to all of my favorite social networks at once. With that said, you might be asking your self several questions including “should our own websites offer web services?”,”Should you make available an API for your website?”. Well, hopefully by the time you’re done reading this, the answer will be much more clear for you.
Let’s look at how this mysterious technology works. First off, take a moment to look at your URL bar the next time you share something on Facebook from another site. You will probably notice the file share.php followed by several variables and strings. Share.php is part of a public API library in which allows users to submit data (possibly via multiple methods but in this case through the url) which gets processed and in this case, added to the user’s wall.
Facebook employs many public scripts such as share.php that allows users to do everything from pull their activity data and display it on a third party site to gain access to another site using their Facebook account. Twitter is another very good and very popular example of a website that employs web services. In fact, it’s probable that Twitter is what put such a high public demand on web services to begin with. Twitter allows developers to use many methods for reading, writing and in some cases, modifying data. Everything from Ajax to Soap can be used to communicate with the service.
In the modern web, you have a wide range of technologies at your finger tips to choose from when communicating data between two remote servers/websites. The most typical and basic method of communicating data is the “GET” method. In the case of the share.php script on Facebook, the link you clicked on to share the video/article was specially formatted to contain variables and data which when passed to Facebook via the URL, would let Facebook know what you were trying to. This method can easily be replicated without being a programmer! Simply hit a “Share on Facebook” button and then copy the URL it generates. Now, paste this URL in notepad and modify the text (make sure to leave everything after “&” and before “=” alone). Then past the new code into the url and hit enter. On Facebook you should now see a preview reflecting the modifications you made. In the following example, you could modify both “hello world, this is a comment!!!” and “Jason” but you would leave “?comment= and &firstname=” alone.
www.somesite.com/sharecomment.php?comment=hello world, this is a comment!!!&firstname=Jason
The Post method works almost the same way, only you will never see post variables displayed in the URL. Post works best for large data and for websites that require security as data can be encrypted via your web browser (using a secure certificate and the https protocol) before being sent out into the world on its own (“get” requests are also encrypted via ssl but limited in character length). The certificate acts as a mediator between the client and host system — the client system encrypts data and the host decrypts data. An example of the post method in mainstream use is Paypal as when the user sees at checkout a customized page including a custom site logo, detailed invoice, etc., formed securely by a small list of hidden form fields,
There are many other types of web services that we use every day without knowing it. These may include searches on websites powered by Google, payment processes that stay within the same site, websites that allow you to login using your Facebook or Twitter account, shipping price calculations…all sorts of stuff!! Basically, whenever a site is utilizing the functionality of another website, they are accessing a web service of some form or another.
How can I add web services to my existing website? Exposing the functionality of your website isn’t all that difficult of a task for any programmer worth his or her weight in salt. Security is something that needs to be strongly addressed however and shutting down the service or blocking users abusing the service is another thing. Typically, most sites that provide a public API will provide you with a unique id to access the services. This id is typically sent with each request made and can be easily targeted and tracked by your website administrators.
After the ground work is laid out, adding services is really a matter of WHAT you want to provide to the world. What power do you want to give to others and to what level? Do you want third party developers to be able to create an iPhone app which can read and update portions of your site? With the web moving forward and interdependencies between sites and services growing every day, it really makes sense to start thinking about the future of your website and how it will continue to expand into the second decade of the 21st century.
Why do I need web services for my site exactly? To be rather brash, use your imagination. I can’t tell you what you want for your website, but I can tell you that this is where the web is heading with tremendous momentum. It doesn’t take an SEO guru to know that the more exposure your website is getting, the more popular it becomes thus the more business you stand to make, not to mention ad revenue and affiliate marketing opportunities.
So the question becomes, do you care about your users? Allowing users of your site to use it the way they want to is really what the trend of “web 2.0” is: the user experience..