Web Services seem to be all the rage right now, and for good reason – they are easy to work with if architected correctly and can interface with a huge range of platforms, which is very important nowadays. Web API is Microsoft’s most recent effort at a light weight service platform, at least for HTTP based services, and I really enjoy working with it.
Orchard has historically done a great job of keeping up with the latest and greatest, and now supports full Web API integration. This is actually a really powerful feature of that platform that I don’t see a lot of people using for whatever reason. You can serve up literally any piece of content from Orchard as JSON through the Web API, so let’s take a look at how this works. There are other examples out there on this topic, but I have found most of them to be very trivial in nature and don’t provide any kind of useful example.
This isn’t an in depth tutorial on Web API, it’s assumed you have at least a basic understanding of how it works but I’ll try to cover the main points to get you up and running.