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 Type Value Notes
    *body

    Pet object that needs to be added to the store

    Responses
    Status Code 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 Type Value Notes
    *body

    Pet object that needs to be added to the store

    Responses
    Status Code 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 Type Value Notes
    *status array

    Status values that need to be considered for filter

    Responses
    Status Code Description Samples
    200

    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 Type Value Notes
    *tags array

    Tags to filter by

    Responses
    Status Code Description Samples
    200

    successful operation

    400

    Invalid tag value

    | Improve this Doc View Source

    deletePet

    Deletes a pet

    Request
    DELETE /pet/{petId}
    Parameters
    Name Type Value Notes
    api_key string
    *petId integer

    Pet id to delete

    Responses
    Status Code 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 Type Value Notes
    *petId integer

    ID of pet to return

    Responses
    Status Code Description Samples
    200

    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 Type Value Notes
    *petId integer

    ID of pet that needs to be updated

    name string

    Updated name of the pet

    status string

    Updated status of the pet

    Responses
    Status Code Description Samples
    405

    Invalid input

    | Improve this Doc View Source

    uploadFile

    uploads an image

    Request
    POST /pet/{petId}/uploadImage
    Parameters
    Name Type Value Notes
    *petId integer

    ID of pet to update

    additionalMetadata string

    Additional data to pass to server

    file file

    file to upload

    Responses
    Status Code Description Samples
    200

    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 Type Value Notes
    *body

    Pet object that needs to be added to the store

    Responses
    Status Code 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 Description Samples
    200

    successful operation

    | Improve this Doc View Source

    placeOrder

    Place an order for a pet

    Request
    POST /store/order
    Parameters
    Name Type Value Notes
    *body

    order placed for purchasing the pet

    Responses
    Status Code Description Samples
    200

    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 Type Value Notes
    *orderId integer

    ID of the order that needs to be deleted

    Responses
    Status Code 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 Type Value Notes
    *orderId integer

    ID of pet that needs to be fetched

    Responses
    Status Code Description Samples
    200

    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 Type Value Notes
    *body

    Created user object

    Responses
    Status Code 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 Type Value Notes
    *body

    List of user object

    Responses
    Status Code 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 Type Value Notes
    *body

    List of user object

    Responses
    Status Code Description Samples
    default

    successful operation

    | Improve this Doc View Source

    loginUser

    Logs user into the system

    Request
    GET /user/login?username&password
    Parameters
    Name Type Value Notes
    *username string

    The user name for login

    *password string

    The password for login in clear text

    Responses
    Status Code Description Samples
    200

    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 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 Type Value Notes
    *username string

    The name that needs to be deleted

    Responses
    Status Code 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 Type Value Notes
    *username string

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

    Responses
    Status Code Description Samples
    200

    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 Type Value Notes
    *username string

    name that need to be updated

    *body

    Updated user object

    Responses
    Status Code Description Samples
    400

    Invalid user supplied

    404

    User not found

    See Alsos

    See other REST APIs:

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