Introduction to API — Learning to float in the deep end

My title may not make total sense but it will in a minute. So just when I thought I was finally getting the gist of things, the day two deliverable is having me feeling like I’ve been thrown into the deep end a little too soon than I had anticipated. This is when I re-examine my reasons for wanting to join Andela. If what am experiencing is anything to go by then being part of the team would not be necessarily a walk in the park. My back aches from too much sitting in the last two days, my eyes are watery from staring at my computer all day and my fingers are on autopilot tapping the keys as I go along. Amazingly however, my spirit is still high and my drive to join Andela has not been hazed by my predicaments at all. I still want to make it as much as I did when I submitted my application.

Anyway enough about my state of mind (and body) and on to my take away for today. I have had to learn about APIs (Application Programming Interfaces). An API is mainly a bridge between my program and a certain application. It specifies the ways my program can interact with an application. For example, if I wanted to write a program that reads and analyzes data from Instagram, I’d need to use the Instagram API, which would specify the process for authentication, important URLs, classes, methods, and so on. Then there are RESTful APIs. For an API to be considered RESTful it must

  • Separate the client from the server
  • Not hold state between requests (meaning that all the information necessary to respond to a request is available in each individual request; no data, or state, is held by the server from request to request)
  • Use HTTP and HTTP methods

I thought this was enough to digest on until I had to deal with JSON which stands for JavaScript Object Notation. From the little I have gathered, it is a text based data-interchange that is language independent and most of the APIs use this. JSON objects are used for transferring data between server and client.

I think my learning curve has exponentially developed today and I feel so enlightened. Hopefully tomorrow is as productive as today was.