PromptsVault AI is thinking...
Searching the best prompts from our community
Searching the best prompts from our community
Prompts matching the #api-design tag
Design clean RESTful APIs. Principles: 1. Use nouns for resources (/users, not /getUsers). 2. HTTP methods: GET (read), POST (create), PUT (update), DELETE (delete). 3. Proper status codes (200 OK, 201 Created, 400 Bad Request, 404 Not Found, 500 Server Error). 4. Versioning (/v1/users). 5. Filtering, sorting, pagination (?page=2&sort=name). 6. HATEOAS (include links to related resources). 7. Consistent naming (camelCase or snake_case). Use JSON. Stateless requests. Authentication with JWT/OAuth. Rate limiting. Comprehensive documentation (OpenAPI/Swagger). Error messages should be helpful.
Design intuitive REST APIs. Guidelines: 1. Noun-based resource URLs. 2. HTTP methods correctly (GET, POST, PUT, DELETE, PATCH). 3. Proper status codes (200, 201, 400, 404, 500). 4. Versioning strategy (/v1/). 5. Pagination for large collections. 6. Filtering, sorting, searching. 7. HATEOAS for discoverability. 8. Consistent error format. Use JSON. Document with OpenAPI/Swagger. Implement rate limiting.
I need to design a RESTful API for a social media application. The resources are Users, Posts, Comments, and Likes. Design the endpoints, including HTTP methods, URL structure, and request/response payloads. Provide examples for creating a new post and fetching comments for a post.
Design a GraphQL schema for a blog application. The schema should define types for Author, Post, and Comment. Include queries to fetch all posts, a single post by ID, and all posts by a specific author. Also, include mutations for creating a new comment.