Creating and Reading API’s, More Git

I’ve had this drafted for awhile but I’ve forgotten to post it so here it goes anyways … again.

In the previous couple of weeks, learning how to add security features to our app was fun, and Devise actually makes a lot of these things easier, so long as we don’t try to add any customization to it afterwards. These next few weeks have been spent on learning how to call API’s and learning how to create them. We also returned to Git, something we’d covered in the first week of class.

API’s are usually stored as JSON files (sometimes they’re stored as XML). JSON (Javascript Object Notation) are a combination of arrays in hashes or vise versa. Calling an API can be simple, depending on how the information you want access to is stored inside the JSON objects. For example calling the API for the city of Chicago’s Food Inspections, wasn’t too difficult, calling the API for Yahoo’s weather was a different story, due to all the extra nesting in their JSON file.

Class time was also spent on creating your own API, and then calling that API from another server. The advantage here is that you can store information that other’s can use, and if you keep all of your data stored in an API, you won’t need a database. Time was also spent on learning how to turn our JSON objects into plain old ruby objects, which is sometimes referred to as PORO.

A class project to create a resume storer was also started. The goal here was to learn how to work together in small groups (around three people per group), and to learn how to collaborate with Git. We learned how to create branches, merge to a master Git file, and create pull requests. Our group specifically focused on creating an API of student’s information, and working the Twitter API so we could pull our classmates Twitter accounts and add them to the project.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s