My API
MMy API
API Reference
POSTCreate a pet in the store/petPUTReplace a pet in the store/petGETGet a pet by ID/pet/{petId}POSTUpdate a pet with form data/pet/{petId}DELETEDelete a pet/pet/{petId}GETFinds Pets by status./pet/findByStatusGETFinds Pets by tags./pet/findByTags
POSTUpload an image for a pet/pet/{petId}/uploadImage
GETGet inventory quantities by status/store/inventoryPOSTPlace an order for a pet/store/order
GETFind purchase order by ID./store/order/{orderId}DELETEDelete purchase order by identifier./store/order/{orderId}
POSTCreate a user account/userGETGet a user by username/user/{username}PUTReplace user details/user/{username}DELETEDelete a user account/user/{username}POSTCreate users from a list/user/createWithListGETLog in a user/user/loginGETLog out the authenticated user/user/logout
llms.txtPowered by Octri
GET/user/login

Log in a user

Authenticates a user by submitting the account name and password as query parameters. Use username and password to sign in; both parameters are optional in the schema. A successful response returns a string.

2 parameters
usernamestringoptional

The user's account name for login.

passwordstringoptional

The user's password for login, sent as clear text.

3 status codes
200Returns a string confirming the login operation.
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. The username and password query parameters are optional in the schema, but valid credentials are needed to log in.

import os

from my_api_sdk import ClientConfig, ClientAuthConfig, SwaggerPetstoreOpenAPI30

config = ClientConfig(
    base_url="/api/v3",
    auth=ClientAuthConfig(bearer=os.environ["SWAGGER_PETSTORE_TOKEN"]),
)
client = SwaggerPetstoreOpenAPI30(config)

result = client.user.login()
Response
"example_value"
PreviousCreate users from a listNextLog out the authenticated user