For this week's learning lunch we took a look at the RubyConf AU 2013 Lightning Talks and Active Model Serializers (RailsCasts). The two presentations tied together nicely as one of the lightning talks was on APIs and the RailsCast was on a way to craft them.
An API (Application Programming Interface) is a set of commands, functions, and protocols which programmers can use when building software for a specific system. Crafting your API correctly is the ticket to happiness, success, and general Good Times. Rails is exceptionally good at exposing an API and there are some great gems available to help in this process.
For the recent Gap Filler app we created and documented an API so that anyone could write their own program to use the data. This means anyone interested could easily create, say, an Android app using the same interface our iPhone app does. For Gap Filler we used the RABL gem which uses a view based approach rather than the more object oriented approach of Active Model Serializers. There are strengths and weaknesses to both approaches, but, as always, it's great to have the choice.
Finally, the last thing to think about and one which was highlighted in the lightning talk, is versioning your API. The reason for this is that once you have an API people tend to use them. If you go changing things then you will likely break all the systems which are depending on your API. For Gap Filler itself we did not include versioning from the start, however, were we to extend the API we would certainly add versioning. For a larger project and one which was likely to have an evolving API we would certainly include versioning from the start and yes, there's the versionist gem for that!
Let's work together
Tell us about your project and we'll get back to you shortly.
Join The Conversation
More On The Blog
2022 ECommerce SEO Checklist: Ranking Factors That Will Matter
It’s no secret that any successful eCommerce store should stay updated with all SEO best practices. We have seen it happen with many of our clients and others in the industry, as lead conversion and mobile revenue are directly tied to your store’s Google rankings. To help you get an in-depth overview of how to rank your store on Google in the future, we have put together a 2022 eCommerce SEO checklist.
Sol Dieguez — Jan 19, 2022
Solidus vs Spree: Which Is Better For Your eCommerce? - 2022 Update
At Resolve Digital, we have clients who prefer to work with both of these platforms. Thanks to years of experience, our team knows the ins and outs of Spree eCommerce and the newer Solidus framework. To help you decide which one is best suited for your company’s online retail needs, we have put together a comparative article explaining the differences between them.
Sol Dieguez — Jan 12, 2022
What's New In eCommerce Trends For 2022
The COVID-19 pandemic accelerated the mainstream use of online retail and helped to position several eCommerce stores within the market. This brought drastic changes to the once usual customer habits and eCommerce global trends. That’s why you need to keep an eye on the latest shifts of the market and optimize your company’s store according to the eCommerce trends for 2022.
Sol Dieguez — Jan 6, 2022