REST is a defacto standard and every developer implements REST APIs in a different way. In this talk I'll show best practices and standards around REST. I hope that helps you to build APIs with higher developer experience.
DEVELOPER EXPERIENCE Why does it matter? users of your technology are happier promote it more stay longer when the product https://hackernoon.com/the-best-practices-for-a-great-developer-experience-dx-9036834382b0
RESOURCE NAMING Use nouns to represent resources plural spinal-case or snake_case hierarchical relationships with slash GET /accounts/1234 GET /accounts/{id}/settings
EXAMPLES JIRA Gitlab Kubernetes Rocket.Chat GET http://www.example.com/jira/rest/api/2/u GET https://gitlab.example.com/api/v4/projec GET https://example.com/api/v1/pods POST http://localhost:3000/api/v1/users.crea
SPECIAL CASES Net ix GitHub Accept Header application/vnd.github.v3+json GET https://api.github.com/repos/me/repo/readme GET http://api.netflix.com/catalog/titles/series/70023522?
LEVEL 1 many URIs only a single HTTP verb – generally HTTP POST POST http://myws.com/api/createAccount POST http://myws.com/api/updateAccount POST http://myws.com/api/deleteAccount
LEVEL 2 URI for every resource using HTTP Verbs, e.g. GET, POST, PUT, DELETE GET http://myws.com/api/accounts POST http://myws.com/api/accounts/2 PUT http://myws.com/api/accounts/2 DELETE http://myws.com/api/accounts/2
STANDARDS JSON API Spec HTTP HTTP Status Codes URI Syntax HATEOAS HAL https://jsonapi.org/ https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol https://en.wikipedia.org/wiki/List_of_HTTP_status_codes https://www.ietf.org/rfc/rfc3986.txt https://en.wikipedia.org/wiki/HATEOAS https://en.wikipedia.org/wiki/Hypertext_Application_Language https://tools.ietf.org/html/draft-kelly-json-hal-00
FRAMEWORKS Spring HATEOAS Spring with JSON API (Karthasis) https://docs.spring.io/spring-hateoas/docs/1.0.1.RELEASE/reference/html/ https://www.baeldung.com/json-api-java-spring-web-app