Get user by username
Get a user by their username.
GET https://petstore3.swagger.io/api/v3/user/{username}
Examples
- API Key
- OAuth 2.0
cURL
GET "https://petstore3.swagger.io/api/v3/user/user1" \
-H "accept: application/json" \
-H "api_key: <YOUR_API_KEY>"
cURL
GET "https://petstore3.swagger.io/api/v3/user/user1" \
-H "accept: application/json" \
-H "Authorization: Bearer <YOUR_OAUTH_TOKEN>"
Responses
| Code | Description |
|---|---|
| 200 | Successful operation |
| 400 | Invalid username supplied |
| 404 | User not found |
| default | Unexpected error |
Response example
200: Successful operation
Response
{
"id": 0,
"username": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"password": "string",
"phone": "string",
"userStatus": 0
}
Parameters
Path parameters
| Name | Type | Description |
|---|---|---|
username | string | The username of the user to fetch. Use "user" for testing. |