A well-designed API is intuitive. A poorly designed API generates support tickets.
Naming
Use nouns, not verbs: /users not /getUsers. Plural: /users/123 not /user/123. Nested resources: /users/123/orders.
HTTP Methods
GET = read. POST = create. PUT = full update. PATCH = partial update. DELETE = remove. Don't use POST for everything.
Error Responses
Always return: HTTP status code + error message + error code. {{'error': 'User not found', 'code': 'USER_NOT_FOUND', 'status': 404}}
Test your APIs with our API tester and format responses with JSON formatter.