2 minute read

APIs, REST, RESTful APIs?

Recently, I attended a hackathon with some coursemates and the challenge was to build a full stack polling application within 16 hours from the time the challenge was introduced. As most of us were more familiar with the frontend framework, and I was the only one who has some experience in the backend. I was tasked to build the backend API.

Of course I could build a microservice with Golang but that would take me a much longer time to get it up and running with documentation and web UI features. Thus, after much research our team decided to try out using Django to handle all our backend services.

What are APIs?

APIs (Application Programming Interface) are a set of functions that allows other applications to interact or access the data. I presume it would be like a cable which connects your computer to your monitor. So your monitor uses the cable (API) to display the information that is generated by your computer.

What is REST then?

REST (Representational State Transfer) is an software architectural style that defines a set of constraints to be used for web services. This is perhaps our request/response from HTTP.

How about RESTful API?

When you combine them both perhaps this would be what we all know as the (GET, PUT, POST, UPDATE, DELETE) commands in an API ? It seems so a little googling skills and this popped out as the answer.

(Restful API) credit: (Techtarget) for the definition.

Why did we try Django?

Because recently my coursemates were learning Python, so the go to library to use was naturally Django. Of course there is the Golang way of building an API, there is the JavaScript way of using Node.JS or Express.JS. There are many different languages we can use to build a backend.

However, after reflecting on the hackathon. I think that we should have settled building a backend with Node.js or Express.js. Which would then allow us to easily implement the connection to the frontend.

When we built both the Frontend and Backend, we realised that we did not know how to connect them together. The APIs work with authentication and using POSTMAN we were able to create users, login and receive the authentication token. But we had no experience or knowlege how to make use of the authentication to persistently allow the frontend to make use of the RESTful APIs commands.

RELATED POSTS |Blog, Learning, Rant

Get in touch 👋

Feel free to email me about anything. I'd love to hear from you!

You can also reach me at: GitHub or LinkedIn