cURL
curl --request POST \ --url https://api.petstoreapi.com/v1/auth/tokens \ --header 'Content-Type: application/json' \ --data ' { "username": "kylekinh", "password": "SecurePass123!" } '
{ "token": "<string>", "expiresAt": "2023-11-07T05:31:56Z" }
Authenticate user and obtain an access token.
Login username
"johndoe"
User password (never returned in responses)
"securePassword123"
Login successful
Authentication token
Token expiration time