Complete the code to define a REST API endpoint that returns user data.
GET /users/[1]The endpoint /users/profile is commonly used to fetch user data, making the API intuitive and usable.
Complete the code to specify the HTTP method for creating a new resource in REST API.
HTTP Method: [1] /itemsThe POST method is used to create new resources, which is a key part of API usability by following standards.
Fix the error in the API response format to improve usability.
{ "status": "success", "data": [1] }The data field should contain a list of user objects for clarity and consistency in API responses.
Fill both blanks to create a clear and consistent API error response.
{ "error_code": [1], "message": "[2]" }A 404 error code with message Not Found clearly informs the user about the missing resource, improving usability.
Fill all three blanks to design an API endpoint with versioning and resource identification.
"/[1]/v[2]/[3]/{id}"
Using /api/v1/users/{id} clearly shows the API base, version, and resource, which helps usability and maintainability.