- APIs
- post addPet
- put updatePet
- get findPetsByStatus
- get findPetsByTags
- get getPetById
- post updatePetWithForm
- delete deletePet
- post uploadFile
- get getInventory
- post placeOrder
- get getOrderById
- delete deleteOrder
- post createUser
- post createUsersWithArrayInput
- post createUsersWithListInput
- get loginUser
- get logoutUser
- get getUserByName
- put updateUser
- delete deleteUser
- Schemas
- Schema Order
- Schema Category
- Schema User
- Schema Tag
- Schema Pet
- Schema ApiResponse
Swagger Petstore 1.0.0
This is a sample server Petstore server. You can find out more about Swagger at https://swagger.io or on irc.freenode.net. For this sample, you can use the api key special-key to test the authorization filters.
Security definitions
petstore_auth
| type | oauth2 | |
|---|---|---|
| authorizationUrl | https://petstore.swagger.io/oauth/dialog | |
| flow | implicit | |
| Scopes |
write:pets - modify pets in your account read:pets - read your pets |
|
api_key
| type | apiKey | |
|---|---|---|
| name | api_key | |
| in | header | |
APIs
POST addPet
Add a new pet to the store
Request
Content-Type: application/json, application/xml
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| body | body | yes | Pet object that needs to be added to the store | - | #definitions/Pet |
Response
Content-Type: application/xml, application/json
PUT updatePet
Update an existing pet
Request
Content-Type: application/json, application/xml
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| body | body | yes | Pet object that needs to be added to the store | - | #definitions/Pet |
Response
Content-Type: application/xml, application/json
GET findPetsByStatus
Multiple status values can be provided with comma separated strings
Finds Pets by status
Request
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| status | query | yes | Status values that need to be considered for filter | - | Array[array] (multi) |
Response
Content-Type: application/xml, application/json
| Status Code | Reason | Response Model |
|---|---|---|
| 200 | successful operation | Array[ #definitions/Pet ] |
| 400 | Invalid status value |
GET findPetsByTags
* Deprecated *Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Finds Pets by tags
Request
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| tags | query | yes | Tags to filter by | - | Array[array] (multi) |
Response
Content-Type: application/xml, application/json
| Status Code | Reason | Response Model |
|---|---|---|
| 200 | successful operation | Array[ #definitions/Pet ] |
| 400 | Invalid tag value |
GET getPetById
Returns a single pet
Find pet by ID
Request
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| petId | path | yes | ID of pet to return | - | integer (int64) |
Response
Content-Type: application/xml, application/json
| Status Code | Reason | Response Model |
|---|---|---|
| 200 | successful operation | #definitions/Pet |
| 400 | Invalid ID supplied | |
| 404 | Pet not found |
POST updatePetWithForm
Updates a pet in the store with form data
Request
Content-Type: application/x-www-form-urlencoded
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| petId | path | yes | ID of pet that needs to be updated | - | integer (int64) |
| name | formData | no | Updated name of the pet | - | string |
| status | formData | no | Updated status of the pet | - | string |
Response
Content-Type: application/xml, application/json
DELETE deletePet
Deletes a pet
Request
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| api_key | header | no | - | string | |
| petId | path | yes | Pet id to delete | - | integer (int64) |
Response
Content-Type: application/xml, application/json
POST uploadFile
uploads an image
Request
Content-Type: multipart/form-data
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| petId | path | yes | ID of pet to update | - | integer (int64) |
| additionalMetadata | formData | no | Additional data to pass to server | - | string |
| file | formData | no | file to upload | - | file |
Response
Content-Type: application/json
| Status Code | Reason | Response Model |
|---|---|---|
| 200 | successful operation | #definitions/ApiResponse |
GET getInventory
Returns a map of status codes to quantities
Returns pet inventories by status
Request
Parameters
Response
Content-Type: application/json
POST placeOrder
Place an order for a pet
Request
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| body | body | yes | order placed for purchasing the pet | - | #definitions/Order |
Response
Content-Type: application/xml, application/json
| Status Code | Reason | Response Model |
|---|---|---|
| 200 | successful operation | #definitions/Order |
| 400 | Invalid Order |
GET getOrderById
For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions
Find purchase order by ID
Request
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| orderId | path | yes | ID of pet that needs to be fetched | - | integer (int64) |
Response
Content-Type: application/xml, application/json
| Status Code | Reason | Response Model |
|---|---|---|
| 200 | successful operation | #definitions/Order |
| 400 | Invalid ID supplied | |
| 404 | Order not found |
DELETE deleteOrder
For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
Delete purchase order by ID
Request
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| orderId | path | yes | ID of the order that needs to be deleted | - | integer (int64) |
Response
Content-Type: application/xml, application/json
POST createUser
This can only be done by the logged in user.
Create user
Request
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| body | body | yes | Created user object | - | #definitions/User |
Response
Content-Type: application/xml, application/json
POST createUsersWithArrayInput
Creates list of users with given input array
Request
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| body | body | yes | List of user object | - | Array[#definitions/User] |
Response
Content-Type: application/xml, application/json
POST createUsersWithListInput
Creates list of users with given input array
Request
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| body | body | yes | List of user object | - | Array[#definitions/User] |
Response
Content-Type: application/xml, application/json
GET loginUser
Logs user into the system
Request
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| username | query | yes | The user name for login | - | string |
| password | query | yes | The password for login in clear text | - | string |
Response
Content-Type: application/xml, application/json
GET logoutUser
Logs out current logged in user session
Request
Parameters
Response
Content-Type: application/xml, application/json
GET getUserByName
Get user by user name
Request
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| username | path | yes | The name that needs to be fetched. Use user1 for testing. | - | string |
Response
Content-Type: application/xml, application/json
| Status Code | Reason | Response Model |
|---|---|---|
| 200 | successful operation | #definitions/User |
| 400 | Invalid username supplied | |
| 404 | User not found |
PUT updateUser
This can only be done by the logged in user.
Updated user
Request
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| username | path | yes | name that need to be updated | - | string |
| body | body | yes | Updated user object | - | #definitions/User |
Response
Content-Type: application/xml, application/json
DELETE deleteUser
This can only be done by the logged in user.
Delete user
Request
Parameters
| Name | Located in | Required | Description | Default | Schema |
|---|---|---|---|---|---|
| username | path | yes | The name that needs to be deleted | - | string |
Response
Content-Type: application/xml, application/json
Definitions
Order
| name | type | required | description | example |
|---|---|---|---|---|
| id | integer (int64) | optional | ||
| petId | integer (int64) | optional | ||
| quantity | integer (int32) | optional | ||
| shipDate | string (date-time) | optional | ||
| status | string | optional | Order Status | placed,approved,delivered |
| complete | boolean | optional |
Category
| name | type | required | description | example |
|---|---|---|---|---|
| id | integer (int64) | optional | ||
| name | string | optional |
User
| name | type | required | description | example |
|---|---|---|---|---|
| id | integer (int64) | optional | ||
| username | string | optional | ||
| firstName | string | optional | ||
| lastName | string | optional | ||
| string | optional | |||
| password | string | optional | ||
| phone | string | optional | ||
| userStatus | integer (int32) | optional | User Status |
Tag
| name | type | required | description | example |
|---|---|---|---|---|
| id | integer (int64) | optional | ||
| name | string | optional |
Pet
| name | type | required | description | example |
|---|---|---|---|---|
| id | integer (int64) | optional | ||
| category | #definitions/Category | optional | ||
| name | string | required | doggie | |
| photoUrls | array [] | required | ||
| tags | array [] #definitions/Tag | optional | ||
| status | string | optional | pet status in the store | available,pending,sold |
ApiResponse
| name | type | required | description | example |
|---|---|---|---|---|
| code | integer (int32) | optional | ||
| type | string | optional | ||
| message | string | optional |