Get User By Name

Get User By Name

Get user detail based on username.

Request
URI
GET
https://petstore3.swagger.io/user/{username}
COPY
Path Parameters
string
username
Required

The name that needs to be fetched. Use user1 for testing


Authentication
This operation uses the following authentication methods.
Responses
200

successful operation

Returns User of type(s) application/json
{
    "id": 10,
    "username": "theUser",
    "firstName": "John",
    "lastName": "James",
    "email": "[email protected]",
    "password": "12345",
    "phone": "12345",
    "userStatus": 1
}
integer As int64 As int64
id
Optional

id

string
username
Optional

username

string
firstName
Optional

firstName

string
lastName
Optional

lastName

string
email
Optional

email

string
password
Optional

password

string
phone
Optional

phone

integer As int32 As int32
userStatus
Optional

User Status


400

Invalid username supplied

Operation doesn't return any data structure

404

User not found

Operation doesn't return any data structure

default

Unexpected error

Returns Error of type(s) application/json
"Error Object"
string
code
Required

code

string
message
Required

message


Code Samples
COPY
                    curl -H 'Authorization: <value>' https://{api_host}/user/{username}