REST API Best Practices

Best practices for REST API helps to avoid mistakes during development. Better quality API gets implemented when best practices are followed by developers.


After reading tones of API success stories,many business & enterprises have started building their own API. While this sounds good, it also create problems in future if the design of the API is not well thought of. This blog throws light on the API design specifically for a business process.However, if you are very new to API and willing to start from level zero, then understand core principle of REST API before reading any further.

Resource is a central part of the API. Resource identifier, Resource representations, API operations everything are built around the resource. Anything is a part of a business can be seen as a resource.Virtual entities such as customer or vendor, non-virtual entities such as subscriptions or orders, business process such a employee on-boarding can be seen a resource.

Getting started with example

For the explanation point of view, lets select a employee on-boarding as a business process. We consider 4 different activities what business perform while on-boarding a employee.

  • Creating employee
  • Assigning a pay manager
  • Creating a user account
  • Create a email Inbox

All the above activities are performed in a sequence and are interrelated. For instance email inbox cannot be created without creating a user account.

When it comes to development time, API first approach will take more time to build a product. With the intention to get the product faster to the market, every entrepreneur ask them-self  the question in the title of this blog.Even though answer is know to be YES in the corner of our mind, there is a natural curiosity to understand more about it before convincing our-self.

I have gone through this stage of flickering mind and have found convincing answers and explanations. This blog  discuss about being API from day one and making our own product a client of that API.

Let’s split the question in two and discuss them separately.

Should I build a API early ?

With the decrease in mobile device cost and internet, most business find their customer engaging more with mobile apps than desktop sites.With this shift, it is clear that business need API from day one. However not all products needs to be over mobile – at-least at the beginning . Even with this scenario , I would suggest to go API first. Private API have proved to have ROI and value addition for business.

Many business today have discovered different revenue channels through collaboration with their partners and 3rd party services.Such collaboration is made possible by opening up company’s data asset via API.

While partner API is essential for growth of the company, building them needs efficient planning and good start. One such good start is building a private API first.

Companies have turned towards API first approach with a vision to build strong revenue stream after few years.Hence one may feel API is not worth investing from way beginning.But the reality is on the other side.This blogs share few thoughts on immediate benefits of private API.

Also read: A drive into the core principle of REST API