2 min read

Best Practices to Take Your API Design Skills to the Next Level

In this world of microservices, a consistent design for your backend API is imperative. We have included some best practices to follow.
Best Practices to Take Your API Design Skills to the Next Level

Any API design follows something called Resource Oriented Design,

It consists of three key concepts

  • Resource: A resource is a piece of data, For example, a User.
  • Collection: A group of resources is called a collection. Example: A list of users
  • URL: Identifies the location of resource or collection. Example: /user

1. Use kebab-case for URLs

eg:/system-orders, if you want to get the list of orders.

2.Use camelCase for Parameters

eg: /system-orders/{orderId}, if you want to get the particular order.

3. Plural Name to Point to a Collection

eg: GET /users if you want to get the all users

4. URL Starts With a Collection and Ends With an Identifier

eg: GET /shops/:shopId/ or GET /category/:categoryId if  want to keep the concept singular and consistent,

5. Use camelCase for JSON property

If you’re building a system in which the request body or response is JSON, the property names should be in `camelCase

eg: {
  userName: "Mohammad Faisal"
  userId: "1"
}

Don't stop reading Click here...

22 Best Practices to Take Your API Design Skills to the Next Level
REST API Design Best Practice| API Design Guideline for Beginners| How to design a good API | Design REST API Like a Pro | Design Guideline for Rest API
src:https://betterprogramming.pub/22-best-practices-to-take-your-api-design-skills-to-the-next-level-65569b200b9

#Backend #API #Design #Skills #Programming #Probyto #ProbytoAI

Subscribe and follow us for latest news in Data Science and Machine learning and stay updated!
Facebook: https://facebook.com/probyto
Twitter: https://twitter.com/probyto
LinkedIn: https://linkedin.com/company/probyto
Instagram: https://instagram.com/probyto