14 rules that I recommend for creating APIs
These are guidelines that I recommend and follow when creating APIs. Very open to discussion as there is not a single way to create web application interfaces.
Agenda:
Pluralize resources
Avoid adding unnecessary routes
Validate permissions on the backend
Avoid extensions in the URL
Do not return arrays at the top level
Do not return dictionaries at the top level
Use String-type identifiers
Use identifiers with prefixes
Avoid using 404 code at the application level
Be consistent in resources and attributes
Use common error structures
Provide idempotence mechanisms
Standardize timestamps
Dynamically document