Published on

API: Be nice to your clients

Authors
  • avatar
    Name
    Hoang Nguyen
    LinkedIn
API

1. Why?

There are so many things that help us to receive strong compliments from clients. I decided to share with you some of them we took and re-used and refined among three different projects. So, you can apply these things to be nice to your clients ❤️❤️❤️.

2. What?

2.1. Swagger

Provide a nice and up-to-date documentation of your APIs.

API

2.2. Unit test

There are many benefits of Unit testing:

  • The process becomes more agile
  • Improve quality of Code
  • Find Bugs more easily
  • Reduce Costs
API

2.3. Handle exception

Exceptions are essentially abnormal conditions that are caught by the hardware (like dividing by zero) or the operating system (like trying to write to a file on a full disk). The number of combinations of the cases in a large, complex program may be much larger, which may increase the burden on the programmer. Exception handling is an easier way than writing several more lines of code to compensate for each case. It can protect the Application from being stuck or terminated.

API

2.4. API Versioning

API versioning is the practice of transparently managing changes to your API. So, with API versioning, you can easily manage API changes by:

  • Continue support for existing properties/endpoints
  • Add new properties/endpoints rather than changing existing ones
  • Thoughtfully sunset obsolete properties/endpoints
API

There are 4 methods to versioning APIs: