Overview
This is a sample server Petstore server. You can find out more about Swagger at http://swagger.io or on "irc.freenode.net, #swagger". For this sample, you can use the api key special-key
to test the authorization filters.
Version information
Version : 1.0.0
Contact information
Contact Email : apiteam@swagger.io
License information
License : Apache 2.0
License URL : http://www.apache.org/licenses/LICENSE-2.0.html
Terms of service : http://swagger.io/terms/
URI scheme
Host : petstore.swagger.io
BasePath : /v2
Schemes : HTTP
Tags
-
pet : Everything about your Pets
-
store : Access to Petstore orders
-
user : Operations about user
External Docs
Description : Find out more about Swagger
URL : http://swagger.io
Paths
Add a new pet to the store
POST /pet
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Body |
body |
Pet object that needs to be added to the store |
Responses
HTTP Code | Description | Schema |
---|---|---|
405 |
Invalid input |
No Content |
Consumes
-
application/json
-
application/xml
Produces
-
application/xml
-
application/json
Tags
-
pet
Security
Type | Name | Scopes |
---|---|---|
oauth2 |
write:pets,read:pets |
Update an existing pet
PUT /pet
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Body |
body |
Pet object that needs to be added to the store |
Responses
HTTP Code | Description | Schema |
---|---|---|
400 |
Invalid ID supplied |
No Content |
404 |
Pet not found |
No Content |
405 |
Validation exception |
No Content |
Consumes
-
application/json
-
application/xml
Produces
-
application/xml
-
application/json
Tags
-
pet
Security
Type | Name | Scopes |
---|---|---|
oauth2 |
write:pets,read:pets |
Finds Pets by status
GET /pet/findByStatus
Description
Multiple status values can be provided with comma separated strings
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Query |
status |
Status values that need to be considered for filter |
< enum (available, pending, sold) > array(multi) |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
successful operation |
< Pet > array |
400 |
Invalid status value |
No Content |
Produces
-
application/xml
-
application/json
Tags
-
pet
Security
Type | Name | Scopes |
---|---|---|
oauth2 |
write:pets,read:pets |
Finds Pets by tags
GET /pet/findByTags
Caution
|
operation.deprecated |
Description
Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Query |
tags |
Tags to filter by |
< string > array(multi) |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
successful operation |
< Pet > array |
400 |
Invalid tag value |
No Content |
Produces
-
application/xml
-
application/json
Tags
-
pet
Security
Type | Name | Scopes |
---|---|---|
oauth2 |
write:pets,read:pets |
Updates a pet in the store with form data
POST /pet/{petId}
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
petId |
ID of pet that needs to be updated |
integer (int64) |
FormData |
name |
Updated name of the pet |
string |
FormData |
status |
Updated status of the pet |
string |
Responses
HTTP Code | Description | Schema |
---|---|---|
405 |
Invalid input |
No Content |
Consumes
-
application/x-www-form-urlencoded
Produces
-
application/xml
-
application/json
Tags
-
pet
Security
Type | Name | Scopes |
---|---|---|
oauth2 |
write:pets,read:pets |
Find pet by ID
GET /pet/{petId}
Description
Returns a single pet
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
petId |
ID of pet to return |
integer (int64) |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
successful operation |
|
400 |
Invalid ID supplied |
No Content |
404 |
Pet not found |
No Content |
Produces
-
application/xml
-
application/json
Tags
-
pet
Security
Type | Name |
---|---|
apiKey |
Deletes a pet
DELETE /pet/{petId}
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Header |
api_key |
string |
|
Path |
petId |
Pet id to delete |
integer (int64) |
Responses
HTTP Code | Description | Schema |
---|---|---|
400 |
Invalid ID supplied |
No Content |
404 |
Pet not found |
No Content |
Produces
-
application/xml
-
application/json
Tags
-
pet
Security
Type | Name | Scopes |
---|---|---|
oauth2 |
write:pets,read:pets |
uploads an image
POST /pet/{petId}/uploadImage
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
petId |
ID of pet to update |
integer (int64) |
FormData |
additionalMetadata |
Additional data to pass to server |
string |
FormData |
file |
file to upload |
file |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
successful operation |
Consumes
-
multipart/form-data
Produces
-
application/json
Tags
-
pet
Security
Type | Name | Scopes |
---|---|---|
oauth2 |
write:pets,read:pets |
Returns pet inventories by status
GET /store/inventory
Description
Returns a map of status codes to quantities
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
successful operation |
< string, integer (int32) > map |
Produces
-
application/json
Tags
-
store
Security
Type | Name |
---|---|
apiKey |
Place an order for a pet
POST /store/order
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Body |
body |
order placed for purchasing the pet |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
successful operation |
|
400 |
Invalid Order |
No Content |
Produces
-
application/xml
-
application/json
Tags
-
store
Find purchase order by ID
GET /store/order/{orderId}
Description
For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
orderId |
ID of pet that needs to be fetched |
integer (int64) |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
successful operation |
|
400 |
Invalid ID supplied |
No Content |
404 |
Order not found |
No Content |
Produces
-
application/xml
-
application/json
Tags
-
store
Delete purchase order by ID
DELETE /store/order/{orderId}
Description
For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
orderId |
ID of the order that needs to be deleted |
integer (int64) |
Responses
HTTP Code | Description | Schema |
---|---|---|
400 |
Invalid ID supplied |
No Content |
404 |
Order not found |
No Content |
Produces
-
application/xml
-
application/json
Tags
-
store
Create user
POST /user
Description
This can only be done by the logged in user.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Body |
body |
Created user object |
Responses
HTTP Code | Description | Schema |
---|---|---|
default |
successful operation |
No Content |
Produces
-
application/xml
-
application/json
Tags
-
user
Creates list of users with given input array
POST /user/createWithArray
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Body |
body |
List of user object |
< User > array |
Responses
HTTP Code | Description | Schema |
---|---|---|
default |
successful operation |
No Content |
Produces
-
application/xml
-
application/json
Tags
-
user
Creates list of users with given input array
POST /user/createWithList
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Body |
body |
List of user object |
< User > array |
Responses
HTTP Code | Description | Schema |
---|---|---|
default |
successful operation |
No Content |
Produces
-
application/xml
-
application/json
Tags
-
user
Logs user into the system
GET /user/login
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Query |
password |
The password for login in clear text |
string |
Query |
username |
The user name for login |
string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
successful operation |
string |
400 |
Invalid username/password supplied |
No Content |
Produces
-
application/xml
-
application/json
Tags
-
user
Logs out current logged in user session
GET /user/logout
Responses
HTTP Code | Description | Schema |
---|---|---|
default |
successful operation |
No Content |
Produces
-
application/xml
-
application/json
Tags
-
user
Get user by user name
GET /user/{username}
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
username |
The name that needs to be fetched. Use user1 for testing. |
string |
Responses
HTTP Code | Description | Schema |
---|---|---|
200 |
successful operation |
|
400 |
Invalid username supplied |
No Content |
404 |
User not found |
No Content |
Produces
-
application/xml
-
application/json
Tags
-
user
Updated user
PUT /user/{username}
Description
This can only be done by the logged in user.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
username |
name that need to be updated |
string |
Body |
body |
Updated user object |
Responses
HTTP Code | Description | Schema |
---|---|---|
400 |
Invalid user supplied |
No Content |
404 |
User not found |
No Content |
Produces
-
application/xml
-
application/json
Tags
-
user
Delete user
DELETE /user/{username}
Description
This can only be done by the logged in user.
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
username |
The name that needs to be deleted |
string |
Responses
HTTP Code | Description | Schema |
---|---|---|
400 |
Invalid username supplied |
No Content |
404 |
User not found |
No Content |
Produces
-
application/xml
-
application/json
Tags
-
user
Definitions
ApiResponse
Name | Schema |
---|---|
code |
integer (int32) |
message |
string |
type |
string |
Category
Name | Schema |
---|---|
id |
integer (int64) |
name |
string |
Order
Name | Description | Schema |
---|---|---|
complete |
Default : |
boolean |
id |
integer (int64) |
|
petId |
integer (int64) |
|
quantity |
integer (int32) |
|
shipDate |
string (date-time) |
|
status |
Order Status |
enum (placed, approved, delivered) |
Pet
Name | Description | Schema |
---|---|---|
category |
||
id |
integer (int64) |
|
name |
Example : |
string |
photoUrls |
< string > array |
|
status |
pet status in the store |
enum (available, pending, sold) |
tags |
< Tag > array |
Tag
Name | Schema |
---|---|
id |
integer (int64) |
name |
string |
User
Name | Description | Schema |
---|---|---|
email |
string |
|
firstName |
string |
|
id |
integer (int64) |
|
lastName |
string |
|
password |
string |
|
phone |
string |
|
userStatus |
User Status |
integer (int32) |
username |
string |
Security
petstore_auth
Type : oauth2
Flow : implicit
Token URL : http://petstore.swagger.io/oauth/dialog
Name | Description |
---|---|
write:pets |
modify pets in your account |
read:pets |
read your pets |
api_key
Type : apiKey
Name : api_key
In : HEADER