Conventions

REST Conventions

  • Accept and respond with JSON

  • Use nouns instead of verbs in endpoint paths. To retrieve a list of cars, use HTTP GET with the endpoint /cars/, not /getcars/

  • Name collections with plural nouns. Example: /cars/, not /car/

  • Nest resources for hierarchical objects. Example: /cars/{id}/reviews

  • Return standard error codes. 4xx errors if the client did something wrong and 5xx errors if something is wrong on the server

  • Allow filtering, sorting, and pagination where a lot of data can be returned

  • Use SSL

  • Version APIs by adding it to the path. Example: https://shop.com/v2/orders/


Stackoverflow REST Best Practices

Last updated