Swagger Petstore
General Information
Version 1.0.0
Schemes
http
Host & base path
petstore.swagger.io/v2/
Terms of Service
External resources
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.
List of API Calls
pet
POST /v2/pet/{petId}/uploadImage
store
user
pet
## Add a new pet to the store
POST /v2/pet
Parameters
| Parameter | Description | Type | In |
|---|---|---|---|
| Pet object that needs to be added to the store | body |
Responses
| Code | Description |
|---|---|
| 405 | Invalid input |
GET /v2/pet/findByStatus
Multiple status values can be provided with comma separated strings
Parameters
| Parameter | Description | Type | In |
|---|---|---|---|
| Status values that need to be considered for filter | array | query |
Responses
| Code | Description |
|---|---|
| 200 | successful operation |
| 400 | Invalid status value |
GET /v2/pet/findByTags
Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Parameters
| Parameter | Description | Type | In |
|---|---|---|---|
| Tags to filter by | array | query |
Responses
| Code | Description |
|---|---|
| 200 | successful operation |
| 400 | Invalid tag value |
GET /v2/pet/{petId}
Returns a single pet
Parameters
| Parameter | Description | Type | In |
|---|---|---|---|
| ID of pet to return | integer | path |
Responses
| Code | Description |
|---|---|
| 200 | successful operation |
| 400 | Invalid ID supplied |
| 404 | Pet not found |
POST /v2/pet/{petId}
Parameters
| Parameter | Description | Type | In |
|---|---|---|---|
| ID of pet that needs to be updated | integer | path |
| Updated name of the pet | string | formData |
| Updated status of the pet | string | formData |
Responses
| Code | Description |
|---|---|
| 405 | Invalid input |
POST /v2/pet/{petId}/uploadImage
Parameters
| Parameter | Description | Type | In |
|---|---|---|---|
| ID of pet to update | integer | path |
| Additional data to pass to server | string | formData |
| file to upload | file | formData |
Responses
| Code | Description |
|---|---|
| 200 | successful operation |
store
## Returns pet inventories by status
GET /v2/store/inventory
Returns a map of status codes to quantities
Parameters
| Parameter | Description | Type | In |
|---|
Responses
| Code | Description |
|---|---|
| 200 | successful operation |
POST /v2/store/order
Parameters
| Parameter | Description | Type | In |
|---|---|---|---|
| order placed for purchasing the pet | body |
Responses
| Code | Description |
|---|---|
| 200 | successful operation |
| 400 | Invalid Order |
GET /v2/store/order/{orderId}
For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions
Parameters
| Parameter | Description | Type | In |
|---|---|---|---|
| ID of pet that needs to be fetched | integer | path |
Responses
| Code | Description |
|---|---|
| 200 | successful operation |
| 400 | Invalid ID supplied |
| 404 | Order not found |
user
## Create user
POST /v2/user
This can only be done by the logged in user.
Parameters
| Parameter | Description | Type | In |
|---|---|---|---|
| Created user object | body |
Responses
| Code | Description |
|---|---|
| default | successful operation |
POST /v2/user/createWithArray
Parameters
| Parameter | Description | Type | In |
|---|---|---|---|
| List of user object | body |
Responses
| Code | Description |
|---|---|
| default | successful operation |
POST /v2/user/createWithList
Parameters
| Parameter | Description | Type | In |
|---|---|---|---|
| List of user object | body |
Responses
| Code | Description |
|---|---|
| default | successful operation |
GET /v2/user/login
Parameters
| Parameter | Description | Type | In |
|---|---|---|---|
| The user name for login | string | query |
| The password for login in clear text | string | query |
Responses
| Code | Description |
|---|---|
| 200 | successful operation |
| 400 | Invalid username/password supplied |
GET /v2/user/logout
Parameters
| Parameter | Description | Type | In |
|---|
Responses
| Code | Description |
|---|---|
| default | successful operation |
GET /v2/user/{username}
Parameters
| Parameter | Description | Type | In |
|---|---|---|---|
| The name that needs to be fetched. Use user1 for testing. | string | path |
Responses
| Code | Description |
|---|---|
| 200 | successful operation |
| 400 | Invalid username supplied |
| 404 | User not found |
Responses
Definitions
(object)
This object has the following properties:
id (integer)
petId (integer)
quantity (integer)
shipDate (string)
status (string, enum)
Order Status
This element must be one of the following enum values:
placedapproveddelivered
complete (boolean)
Default: false
(object)
This object has the following properties:
id (integer)
name (string)
(object)
This object has the following properties:
id (integer)
username (string)
firstName (string)
lastName (string)
email (string)
password (string)
phone (string)
userStatus (integer)
User Status
(object)
This object has the following properties:
id (integer)
name (string)
(object)
This object has the following properties:
id (integer)
category (object)
The category object has the following properties:
id (integer)
name (string)
name (string, required)
photoUrls (array, required)
All array elements must be of type:
(string)
tags (array)
All array elements must be of type:
(object)
This object has the following properties:
id (integer)
name (string)
status (string, enum)
pet status in the store
This element must be one of the following enum values:
availablependingsold
(object)
This object has the following properties: