Skip to content

Latest commit

 

History

History
69 lines (62 loc) · 1.2 KB

api-endpoints.md

File metadata and controls

69 lines (62 loc) · 1.2 KB

API Endpoints

UserController

Get User by Country

  • URL: /user/:country
  • Method: GET
  • URL Params:
    • country=[string] (required)
  • Success Response:
    • Code: 200
    • Content:
      {
        "FirstName": "John",
        "LastName": "Doe",
        "Gender": "male",
        "Email": "[email protected]",
        "Phone": "123-456-7890",
        "Address": {
          "Street": "123 Main St",
          "City": "Anytown",
          "State": "Anystate",
          "Zip": "12345"
        }
      }
  • Error Response:
    • Code: 404 NOT FOUND
    • Content:
      {
        "status": "error",
        "message": "Country not found"
      }
    • Code: 500 INTERNAL SERVER ERROR
    • Content:
      {
        "status": "error",
        "message": "Internal server error"
      }

Example Request

curl -X GET "http://localhost:3000/user/US"

Example Response

{
  "FirstName": "John",
  "LastName": "Doe",
  "Gender": "male",
  "Email": "[email protected]",
  "Phone": "123-456-7890",
  "Address": {
    "Street": "123 Main St",
    "City": "Anytown",
    "State": "Anystate",
    "Zip": "12345"
  }
}