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 |
|
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 |
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 |
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 |
string |
name that need to be updated |
body Required |
|
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 |
integer |
ID of pet to update |
additionalMetadata |
string |
Additional data to pass to server |
file |
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 |
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 |
|
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 |
string |
The user name for login |
password Required |
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 |
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 |
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 |
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 |
|
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 |
|
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 |
|
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 |
integer |
ID of pet that needs to be updated |
name |
string |
Updated name of the pet |
status |
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 |
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 |
string |
|
petId Required |
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 |
|
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