Swagger Petstore

This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.

Version 1.0.0, created by [email protected]

Methods

createUsersWithArrayInput

https://petstore.swagger.io/v2usercreateWithArray

POST Creates list of users with given input array

Parameter

In

Description

body

Required

body

List of user object

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

default

successful operation

getUserByName

https://petstore.swagger.io/v2userusername

GET Get user by user name

Parameter

In

Description

username

Required

path

string

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

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

200

successful operation

400

Invalid username supplied

404

User not found

deleteUser

https://petstore.swagger.io/v2userusername

DELETE Delete user

Parameter

In

Description

username

Required

path

string

The name that needs to be deleted

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

400

Invalid username supplied

404

User not found

updateUser

https://petstore.swagger.io/v2userusername

PUT Updated user

Parameter

In

Description

username

Required

path

string

name that need to be updated

body

Required

body

Updated user object

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

400

Invalid user supplied

404

User not found

uploadFile

https://petstore.swagger.io/v2petpetIduploadImage

POST uploads an image

This API call consumes the following media types via the Content-Type request header:

multipart/form-data

Parameter

In

Description

petId

Required

path

integer

ID of pet to update

additionalMetadata

formData

string

Additional data to pass to server

file

formData

file

file to upload

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/json

Response Code

Description

200

successful operation

findPetsByStatus

https://petstore.swagger.io/v2petfindByStatus

GET Finds Pets by status

Parameter

In

Description

status

Required

query

array

Status values that need to be considered for filter

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

200

successful operation

400

Invalid status value

createUsersWithListInput

https://petstore.swagger.io/v2usercreateWithList

POST Creates list of users with given input array

Parameter

In

Description

body

Required

body

List of user object

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

default

successful operation

loginUser

https://petstore.swagger.io/v2userlogin

GET Logs user into the system

Parameter

In

Description

username

Required

query

string

The user name for login

password

Required

query

string

The password for login in clear text

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

200

successful operation

400

Invalid username/password supplied

getInventory

https://petstore.swagger.io/v2storeinventory

GET Returns pet inventories by status

Parameter

In

Description

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/json

Response Code

Description

200

successful operation

logoutUser

https://petstore.swagger.io/v2userlogout

GET Logs out current logged in user session

Parameter

In

Description

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

default

successful operation

findPetsByTags

https://petstore.swagger.io/v2petfindByTags

GET Finds Pets by tags

Parameter

In

Description

tags

Required

query

array

Tags to filter by

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

200

successful operation

400

Invalid tag value

getOrderById

https://petstore.swagger.io/v2storeorderorderId

GET Find purchase order by ID

Parameter

In

Description

orderId

Required

path

integer

ID of pet that needs to be fetched

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

200

successful operation

400

Invalid ID supplied

404

Order not found

deleteOrder

https://petstore.swagger.io/v2storeorderorderId

DELETE Delete purchase order by ID

Parameter

In

Description

orderId

Required

path

integer

ID of the order that needs to be deleted

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

400

Invalid ID supplied

404

Order not found

createUser

https://petstore.swagger.io/v2user

POST Create user

Parameter

In

Description

body

Required

body

Created user object

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

default

successful operation

addPet

https://petstore.swagger.io/v2pet

POST Add a new pet to the store

This API call consumes the following media types via the Content-Type request header:

application/json,application/xml

Parameter

In

Description

body

Required

body

Pet object that needs to be added to the store

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

405

Invalid input

updatePet

https://petstore.swagger.io/v2pet

PUT Update an existing pet

This API call consumes the following media types via the Content-Type request header:

application/json,application/xml

Parameter

In

Description

body

Required

body

Pet object that needs to be added to the store

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

400

Invalid ID supplied

404

Pet not found

405

Validation exception

updatePetWithForm

https://petstore.swagger.io/v2petpetId

POST Updates a pet in the store with form data

This API call consumes the following media types via the Content-Type request header:

application/x-www-form-urlencoded

Parameter

In

Description

petId

Required

path

integer

ID of pet that needs to be updated

name

formData

string

Updated name of the pet

status

formData

string

Updated status of the pet

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

405

Invalid input

getPetById

https://petstore.swagger.io/v2petpetId

GET Find pet by ID

Parameter

In

Description

petId

Required

path

integer

ID of pet to return

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

200

successful operation

400

Invalid ID supplied

404

Pet not found

deletePet

https://petstore.swagger.io/v2petpetId

DELETE Deletes a pet

Parameter

In

Description

api_key

header

string

petId

Required

path

integer

Pet id to delete

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

400

Invalid ID supplied

404

Pet not found

placeOrder

https://petstore.swagger.io/v2storeorder

POST Place an order for a pet

Parameter

In

Description

body

Required

body

order placed for purchasing the pet

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

application/xml,application/json

Response Code

Description

200

successful operation

400

Invalid Order

Questions and Feedback

If you have any comments on this page, feel free to add suggestions right to the Google document that we are using to generate this page.

Last Updated: 27.12.16

Share on Google+Share on FacebookShare on TwitterShare on LinkedIn