For retrieving single record we use GET method with resource name and suffix the record id Example: GET: /case-files/123 – return case file with id = 123 For listing all records we use GET method with resource name Example: GET: /case-files – this should return all...
RESTFul Guidelines
Responses
Responses should be standardized. Consumer should expect always that will get same response structure whether was for successful or error responses. Consumer should expect that HTTP Status codes will be used correctly, and our defined statuses should be documented....
Versioning
Multiple ways to achieve versioning: In URI: Example: /my-api/v2/resource In Accept Header as custom media type: Example:Accept: application/vnd.case-file.v2 + json In URI as parameter: Example: /my-api/resources?version=2 As custom header: Example:X-APIVersion: 2 In...
Writing URI
Resource Name Resources names are ALWAYS nouns in plural Example: /case-files, /complaints, etc. Concatenating resource names is with hyphen(dash) ”-”: Example case-files, person-associations, etc Resource name should be intuitive URI should always represent resource...