Swagger Petstore - OpenAPI 3.0
GET/user/login

Log in a user

Authenticates a user by validating login credentials. Supply username and password as query parameters when signing in, and use the returned token or session information for subsequent authenticated operations.

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

3 status codes
200Returns an authentication token or session value as a string in JSON or XML format.
400Returned when the supplied username or password is invalid.
defaultUnexpected error

Error handling

A 400 is returned when the supplied username or password is invalid. Provide the credentials as strings and do not omit either value when attempting authentication.