Sample - Swagger Petstore OpenAPI 3
GET/user/{username}

Get a user by username

Retrieves a user by the user's name. Supply username to identify the user record you want to retrieve. The response contains the user's profile and account-status fields.

  • RetriesRetries up to 2×, 500ms backoff, 30s timeout.

1 parameter
usernamestringrequired
The username of the user to retrieve.

4 status codes
200Returns the matching user object with identity, contact, credential, and account-status fields.
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`.
defaultReturned when an unexpected error occurs.

Error handling

A 400 is returned when username is invalid. A 404 is returned when no user exists for the supplied username, so use a username that identifies an existing user.