Sample - Swagger Petstore OpenAPI 3
GET/user/login

Log in a user

Authenticates a user by submitting login credentials. Supply username and password as query parameters when attempting to establish a user session. A successful response returns a string representing the login result.

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

2 parameters
usernamestringoptional
The user's name to use for login.
passwordstringoptional
The user's password in clear text for login.

3 status codes
200Returns a string containing the successful login result.
400Returned when the supplied username or password is invalid.
defaultReturned when an unexpected error occurs.

Error handling

A 400 is returned when the supplied username or password is invalid. Provide both credentials as strings when authenticating the user.