- Know the fundamental concepts of REST and do not consider REST to be confined to HTTP.
- Using JSON as your resource sharing format wherever applicable.
- For CRUD applications use nouns to identify to resources as we already have the HTTP methods like GET,POST,DELETE,PUT and PATCH to suggest the type of operation.
So instead ofhttps://testsite.com/create-article
make a post endpoint ofhttps://testsite.com/article
- For a collection of resources of similar type e.g tweets, make the endpoint noun plural to suggest that.
https://testsite.com/tweets/33
- To show nesting of resources e.g tweets and author of tweet nest them in the endpoint
e.g
https://testsite.com/tweets/33/author
- Even after releasing newer versions of the API always thoroughly test and maintain the previous versions as well, as your client might be using older version and might not be able to migrate to latest one.
- Try not share large object over HTTP rather share a link to the object from a CND bucket.
- Not provide appropriate status/error messages in response body.
- Not maintaing clear and concise documentation along with examples and FAQ for each released version.
- Not having any authentication from client.
- Not validating the data/request parameters received from client.
- Not using filters, pagination or data limit while sharing the data in response.