Swagger Petstore - OpenAPI 3.0
GET/user/{username}

Get a user by username

Retrieves a user account by its username. Supply username to fetch the corresponding user details, using user1 when testing with the example account described by the API.

1 parameter
usernamestringrequired
The username of the user to retrieve; use user1 for testing.

4 status codes
200Returns the requested user object with its identifier, account details, contact information, and status.
idintegeroptional
usernamestringoptional
firstNamestringoptional
lastNamestringoptional
emailstringoptional
passwordstringoptional
phonestringoptional
userStatusintegeroptional
User Status
400Returned when the supplied username is invalid.
404Returned when no user exists with the supplied username.
defaultUnexpected error

Error handling

A 400 is returned when username is invalid. A 404 is returned when no user exists with the supplied username, so the value must identify an existing user account.