Show / Hide Table of Contents

    Swagger Petstore

    Describe APIs in Pet Store

    pet

    Description for pet tag

    | Improve this Doc View Source

    addPet

    Add a new pet to the store

    Request
    POST /pet
    Parameters
    Name In Type Default Notes
    *body body Pet

    Pet object that needs to be added to the store

    Responses
    Status Code Type Description Samples
    405

    Invalid input

    NOTE: Add pet only when you needs.

    | Improve this Doc View Source

    updatePet

    Update an existing pet

    Request
    PUT /pet
    Parameters
    Name In Type Default Notes
    *body body Pet

    Pet object that needs to be added to the store

    Responses
    Status Code Type Description Samples
    400

    Invalid ID supplied

    404

    Pet not found

    405

    Validation exception

    | Improve this Doc View Source

    findPetsByStatus

    Finds Pets by status

    Multiple status values can be provided with comma separated strings

    Request
    GET /pet/findByStatus?status
    Parameters
    Name In Type Default Notes
    *status query

    Status values that need to be considered for filter

    Responses
    Status Code Type Description Samples
    200 Pet []

    successful operation

    400

    Invalid status value

    | Improve this Doc View Source

    findPetsByTags

    Finds Pets by tags

    Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

    Request
    GET /pet/findByTags?tags
    Parameters
    Name In Type Default Notes
    *tags query

    Tags to filter by

    Responses
    Status Code Type Description Samples
    200 Pet []

    successful operation

    400

    Invalid tag value

    | Improve this Doc View Source

    deletePet

    Deletes a pet

    Request
    DELETE /pet/{petId}
    Parameters
    Name In Type Default Notes
    api_key header
    *petId path

    Pet id to delete

    Responses
    Status Code Type Description Samples
    400

    Invalid ID supplied

    404

    Pet not found

    | Improve this Doc View Source

    getPetById

    Find pet by ID

    Returns a single pet

    Request
    GET /pet/{petId}
    Parameters
    Name In Type Default Notes
    *petId path

    ID of pet to return

    Responses
    Status Code Type Description Samples
    200 Pet

    successful operation

    400

    Invalid ID supplied

    404

    Pet not found

    | Improve this Doc View Source

    updatePetWithForm

    Updates a pet in the store with form data

    Request
    POST /pet/{petId}
    Parameters
    Name In Type Default Notes
    *petId path

    ID of pet that needs to be updated

    name formData

    Updated name of the pet

    status formData

    Updated status of the pet

    Responses
    Status Code Type Description Samples
    405

    Invalid input

    | Improve this Doc View Source

    uploadFile

    uploads an image

    Request
    POST /pet/{petId}/uploadImage
    Parameters
    Name In Type Default Notes
    *petId path

    ID of pet to update

    additionalMetadata formData

    Additional data to pass to server

    file formData

    file to upload

    Responses
    Status Code Type Description Samples
    200 ApiResponse

    successful operation

    store

    Access to Petstore orders

    Additional description for store tag

    | Improve this Doc View Source

    addPet

    Add a new pet to the store

    Request
    POST /pet
    Parameters
    Name In Type Default Notes
    *body body Pet

    Pet object that needs to be added to the store

    Responses
    Status Code Type Description Samples
    405

    Invalid input

    NOTE: Add pet only when you needs.

    | Improve this Doc View Source

    getInventory

    Returns pet inventories by status

    Returns a map of status codes to quantities

    Request
    GET /store/inventory
    Responses
    Status Code Type Description Samples
    200 object

    successful operation

    | Improve this Doc View Source

    placeOrder

    Place an order for a pet

    Request
    POST /store/order
    Parameters
    Name In Type Default Notes
    *body body Order

    order placed for purchasing the pet

    Responses
    Status Code Type Description Samples
    200 Order

    successful operation

    400

    Invalid Order

    | Improve this Doc View Source

    deleteOrder

    Delete purchase order by ID

    For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors

    Request
    DELETE /store/order/{orderId}
    Parameters
    Name In Type Default Notes
    *orderId path

    ID of the order that needs to be deleted

    Responses
    Status Code Type Description Samples
    400

    Invalid ID supplied

    404

    Order not found

    | Improve this Doc View Source

    getOrderById

    Find purchase order by ID

    For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions

    Request
    GET /store/order/{orderId}
    Parameters
    Name In Type Default Notes
    *orderId path

    ID of pet that needs to be fetched

    Responses
    Status Code Type Description Samples
    200 Order

    successful operation

    400

    Invalid ID supplied

    404

    Order not found

    user

    Operations about user

    | Improve this Doc View Source

    createUser

    Create user

    This can only be done by the logged in user.

    Request
    POST /user
    Parameters
    Name In Type Default Notes
    *body body User

    Created user object

    Responses
    Status Code Type Description Samples
    default

    successful operation

    | Improve this Doc View Source

    createUsersWithArrayInput

    Creates list of users with given input array

    Request
    POST /user/createWithArray
    Parameters
    Name In Type Default Notes
    *body body User []

    List of user object

    Responses
    Status Code Type Description Samples
    default

    successful operation

    | Improve this Doc View Source

    createUsersWithListInput

    Creates list of users with given input array

    Request
    POST /user/createWithList
    Parameters
    Name In Type Default Notes
    *body body User []

    List of user object

    Responses
    Status Code Type Description Samples
    default

    successful operation

    | Improve this Doc View Source

    loginUser

    Logs user into the system

    Request
    GET /user/login?username&password
    Parameters
    Name In Type Default Notes
    *username query

    The user name for login

    *password query

    The password for login in clear text

    Responses
    Status Code Type Description Samples
    200 string

    successful operation

    400

    Invalid username/password supplied

    | Improve this Doc View Source

    logoutUser

    Logs out current logged in user session

    Request
    GET /user/logout
    Responses
    Status Code Type Description Samples
    default

    successful operation

    | Improve this Doc View Source

    deleteUser

    Delete user

    This can only be done by the logged in user.

    Request
    DELETE /user/{username}
    Parameters
    Name In Type Default Notes
    *username path

    The name that needs to be deleted

    Responses
    Status Code Type Description Samples
    400

    Invalid username supplied

    404

    User not found

    | Improve this Doc View Source

    getUserByName

    Get user by user name

    Request
    GET /user/{username}
    Parameters
    Name In Type Default Notes
    *username path

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

    Responses
    Status Code Type Description Samples
    200 User

    successful operation

    400

    Invalid username supplied

    404

    User not found

    Other APIs

    | Improve this Doc View Source

    updateUser

    Updated user

    This can only be done by the logged in user.

    Request
    PUT /user/{username}
    Parameters
    Name In Type Default Notes
    *username path

    name that need to be updated

    *body body User

    Updated user object

    Responses
    Status Code Type Description Samples
    400

    Invalid user supplied

    404

    User not found

    Definitions

    Pet

    Name Type Notes
    category Category[]
    id integer (int64)
    name string
    photoUrls array
    status string

    pet status in the store

    tags Tag[]

    Category

    Name Type Notes
    id integer (int64)
    name string

    Tag

    Name Type Notes
    id integer (int64)
    name string

    ApiResponse

    Name Type Notes
    code integer (int32)
    message string
    type string

    Order

    Name Type Notes
    complete boolean
    id integer (int64)
    petId integer (int64)
    quantity integer (int32)
    shipDate string (date-time)
    status string

    Order Status

    User

    Name Type Notes
    email string
    firstName string
    id integer (int64)
    lastName string
    password string
    phone string
    userStatus integer (int32)

    User Status

    username string

    See Alsos

    See other REST APIs:

    • Contacts API
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX