Swagger Petstore
This is a sample server Petstore server.
Learn about Swagger or join the IRC channel #swagger
on irc.freenode.net.
For this sample, you can use the api key special-key
to test the authorization filters
Contact Info: hello@helloreverb.com
Version: 1.0.0
BasePath:/v2
Apache 2.0
http://www.apache.org/licenses/LICENSE-2.0.html
Access
- APIKey KeyParamName:api_key KeyInQuery:false KeyInHeader:true
- OAuth AuthorizationUrl:http://petstore.swagger.io/api/oauth/dialogTokenUrl:
Methods
[ Jump to Models ]Table of Contents
Pet
post /pets
delete /pets/{petId}
get /pets/findByStatus
get /pets/findByTags
get /pets/{petId}
put /pets
post /pets/{petId}
Store
User
post /users
post /users/createWithArray
post /users/createWithList
delete /users/{username}
get /users/{username}
get /users/login
get /users/logout
put /users/{username}
Pet
Up
post /pets
Add a new pet to the store (addPet)
Consumes
This API call consumes the following media types via the Content-Type request header:application/json
application/xml
Request body
body body_1 (optional)
Body Parameter — Pet object that needs to be added to the store
Produces
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
application/xml
Responses
405
Invalid inputUp
delete /pets/{petId}
Deletes a pet (deletePet)
Path parameters
petId (required)
Path Parameter — Pet id to delete format: int64
Request headers
Produces
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
application/xml
Responses
400
Invalid pet valueUp
get /pets/findByStatus
Finds Pets by status (findPetsByStatus)
Multiple status values can be provided with comma seperated strings
Query parameters
status (optional)
Query Parameter — Status values that need to be considered for filter
Return type
array[inline_response_200]
Example data
Content-Type: application/json
[ {
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
"id" : 0,
"category" : {
"name" : "aeiou",
"id" : 6
},
"tags" : [ "" ],
"status" : "aeiou"
} ]
Example data
Content-Type: application/xml
123456789
doggie
aeiou
aeiou
Produces
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
application/xml
Responses
200
successful operation400
Invalid status valueUp
get /pets/findByTags
Finds Pets by tags (findPetsByTags)
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
Query parameters
tags (optional)
Query Parameter — Tags to filter by
Return type
array[inline_response_200]
Example data
Content-Type: application/json
[ {
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
"id" : 0,
"category" : {
"name" : "aeiou",
"id" : 6
},
"tags" : [ "" ],
"status" : "aeiou"
} ]
Example data
Content-Type: application/xml
123456789
doggie
aeiou
aeiou
Produces
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
application/xml
Responses
200
successful operation400
Invalid tag valueUp
get /pets/{petId}
Find pet by ID (getPetById)
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
Path parameters
petId (required)
Path Parameter — ID of pet that needs to be fetched format: int64
Return type
Example data
Content-Type: application/json
{
"photoUrls" : [ "aeiou" ],
"name" : "doggie",
"id" : 0,
"category" : {
"name" : "aeiou",
"id" : 6
},
"tags" : [ "" ],
"status" : "aeiou"
}
Example data
Content-Type: application/xml
123456789
doggie
aeiou
aeiou
Produces
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
application/xml
Responses
200
successful operation inline_response_200400
Invalid ID supplied404
Pet not foundUp
put /pets
Update an existing pet (updatePet)
Consumes
This API call consumes the following media types via the Content-Type request header:application/json
application/xml
Request body
body body (optional)
Body Parameter — Pet object that needs to be added to the store
Produces
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
application/xml
Responses
400
Invalid ID supplied404
Pet not found405
Validation exceptionUp
post /pets/{petId}
Updates a pet in the store with form data (updatePetWithForm)
Path parameters
petId (required)
Path Parameter — ID of pet that needs to be updated
Consumes
This API call consumes the following media types via the Content-Type request header:application/x-www-form-urlencoded
Form parameters
name (required)
Form Parameter — Updated name of the pet
status (required)
Form Parameter — Updated status of the pet
Produces
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
application/xml
Responses
405
Invalid inputStore
Up
delete /stores/order/{orderId}
Delete purchase order by ID (deleteOrder)
For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
Path parameters
orderId (required)
Path Parameter — ID of the order that needs to be deleted
Produces
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
application/xml
Responses
400
Invalid ID supplied404
Order not foundUp
get /stores/order/{orderId}
Find purchase order by ID (getOrderById)
For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
Path parameters
orderId (required)
Path Parameter — ID of pet that needs to be fetched
Return type
Example data
Content-Type: application/json
{
"petId" : 6,
"quantity" : 1,
"id" : 0,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"complete" : true,
"status" : "aeiou"
}
Example data
Content-Type: application/xml
123456789
123456789
123
2000-01-23T04:56:07.000Z
aeiou
true
Produces
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
application/xml
Responses
200
successful operation inline_response_200_1400
Invalid ID supplied404
Order not foundUp
post /stores/order
Place an order for a pet (placeOrder)
Request body
body body_2 (optional)
Body Parameter — order placed for purchasing the pet
Return type
Example data
Content-Type: application/json
{
"petId" : 6,
"quantity" : 1,
"id" : 0,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"complete" : true,
"status" : "aeiou"
}
Example data
Content-Type: application/xml
123456789
123456789
123
2000-01-23T04:56:07.000Z
aeiou
true
Produces
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
application/xml
Responses
200
successful operation inline_response_200_1400
Invalid OrderUser
Up
post /users
Create user (createUser)
This can only be done by the logged in user.
Request body
body body_3 (optional)
Body Parameter — Created user object
Produces
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
application/xml
Responses
default
successful operationUp
post /users/createWithArray
Creates list of users with given input array (createUsersWithArrayInput)
Request body
body body_4 (optional)
Body Parameter — List of user object
Produces
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
application/xml
Responses
default
successful operationUp
post /users/createWithList
Creates list of users with given input array (createUsersWithListInput)
Request body
body body_4 (optional)
Body Parameter — List of user object
Produces
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
application/xml
Responses
default
successful operationUp
delete /users/{username}
Delete user (deleteUser)
This can only be done by the logged in user.
Path parameters
username (required)
Path Parameter — The name that needs to be deleted
Produces
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
application/xml
Responses
400
Invalid username supplied404
User not foundUp
get /users/{username}
Get user by user name (getUserByName)
Path parameters
username (required)
Path Parameter — The name that needs to be fetched. Use user1 for testing.
Return type
Example data
Content-Type: application/json
{
"firstName" : "aeiou",
"lastName" : "aeiou",
"password" : "aeiou",
"userStatus" : 6,
"phone" : "aeiou",
"id" : 0,
"email" : "aeiou",
"username" : "aeiou"
}
Example data
Content-Type: application/xml
123456789
aeiou
aeiou
aeiou
aeiou
aeiou
aeiou
123
Produces
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
application/xml
Responses
200
successful operation body_4400
Invalid username supplied404
User not foundUp
get /users/login
Logs user into the system (loginUser)
Query parameters
username (optional)
Query Parameter — The user name for login
password (optional)
Query Parameter — The password for login in clear text
Return type
String
Example data
Content-Type: application/json
"aeiou"
Example data
Content-Type: application/xml
aeiou
Produces
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
application/xml
Responses
200
successful operation String400
Invalid username/password suppliedUp
get /users/logout
Logs out current logged in user session (logoutUser)
Produces
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
application/xml
Responses
default
successful operationUp
put /users/{username}
Updated user (updateUser)
This can only be done by the logged in user.
Path parameters
username (required)
Path Parameter — name that need to be deleted
Request body
body body_5 (optional)
Body Parameter — Updated user object
Produces
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
application/xml
Responses
400
Invalid user supplied404
User not foundModels
[ Jump to Methods ]Table of Contents
Category
-Order
-Pet
-Tag
-User
-body
-body_1
-body_2
-body_3
-body_4
-body_5
-inline_response_200
-inline_response_200_1
-pets_category
-