Swagger Petstore - OpenAPI 3.0
GET/user/login

Log in a user

Authenticates a user by validating supplied login credentials. Pass username and password as query parameters when signing in; both parameters may be omitted by the schema but are needed to provide credentials. A successful response returns an authentication result as a string.

2 parameters
usernamestringoptional
The username used to authenticate the user.
passwordstringoptional
The user's password in clear text for authentication.

3 status codes
200Returns the successful authentication result as a string.
400Returned when the supplied username or password is invalid.
defaultUnexpected error

Error handling

A 400 is returned when the supplied username or password credentials are invalid. Provide both parameters as strings and send the password in clear text as specified by the operation.