Users
Log in a user
Send username and password query values and inspect the login response headers.
Logs a user into the sample system and returns a string. The operation declares no security requirement.
Log a user into the system.
GET
/user/loginUsername for login.
Password sent as clear text in the query value, as described by the contract.
Response
{200}Successful operation
{400}Invalid username or password supplied
cURL
curl --request GET \ --url https://petstore3.swagger.io/api/v3/user/login?username=theUser&password=example-password
"example_session_value"
The 200 response also defines X-Rate-Limit, an integer number of calls allowed per hour, and X-Expires-After, a UTC date-time when the token expires.
Do not use a real password in a shared URL or copied example. Query values can be retained in client, proxy, or server logs.
The contract also defines a default Unexpected error response without a fixed status or body schema.