This is an exciting section as we are going to learn how to work with API calls in Ruby. We'll start out with a basic API example and get into more advanced ways to work with APIs in subsequent guides.
In the last lesson: Introduction to APIs in Ruby, we created our custom class to call an application that I already have on the web. In this lesson, we are going to see some shortcuts to use the HTTParty RubyGem.
In the last lesson we walked through a HTTParty RubyGem guide, and we learned how to integrate built in classes from the gem to call an API. If you need something more specific, it's a good idea to create a separate class to manage it. That's what we are going to do in this lesson, while still leveraging some of the key modules supplied by HTTParty.
In our previous lessons on APIs, we were able to get the data we wanted from different APIs, however they all came together, were difficult to read, and weren't very useful. So, in this lesson, we are going to learn to parse the API so that we can get the data we want for further processing.
devCamp does not support ancient browsers.
Install a modern version for best experience.