Swagger Petstore (1.0.6)
Download OpenAPI specification:Download
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.
uploads an image
Authorizations:
write:pets
read:pets
path Parameters
petId required | integer <int64> ID of pet to update |
Request Body schema: multipart/form-data
additionalMetadata | string Additional data to pass to server |
file | string <binary> file to upload |
Responses
Response samples
- 200
{- "code": 0,
- "type": "string",
- "message": "string"
}
Add a new pet to the store
Authorizations:
write:pets
read:pets
Request Body schema:
Pet object that needs to be added to the store
id | integer <int64> |
object (Category) | |
name required | string |
photoUrls required | Array of strings |
Array of objects (Tag) [ items ] | |
status | string Enum: "available" "pending" "sold" pet status in the store |
Responses
Request samples
- Payload
{- "id": 0,
- "category": {
- "id": 0,
- "name": "string"
}, - "name": "doggie",
- "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}
Update an existing pet
Authorizations:
write:pets
read:pets
Request Body schema:
Pet object that needs to be added to the store
id | integer <int64> |
object (Category) | |
name required | string |
photoUrls required | Array of strings |
Array of objects (Tag) [ items ] | |
status | string Enum: "available" "pending" "sold" pet status in the store |
Responses
Request samples
- Payload
{- "id": 0,
- "category": {
- "id": 0,
- "name": "string"
}, - "name": "doggie",
- "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}
Finds Pets by status
Multiple status values can be provided with comma separated strings
Authorizations:
write:pets
read:pets
query Parameters
status required | Array of strings Items Enum: "available" "pending" "sold" Status values that need to be considered for filter |
Responses
Response samples
- 200
[- {
- "id": 0,
- "category": {
- "id": 0,
- "name": "string"
}, - "name": "doggie",
- "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}
]
Finds Pets by tags Deprecated
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Authorizations:
write:pets
read:pets
query Parameters
tags required | Array of strings Tags to filter by |
Responses
Response samples
- 200
[- {
- "id": 0,
- "category": {
- "id": 0,
- "name": "string"
}, - "name": "doggie",
- "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}
]
Find pet by ID
Returns a single pet
Authorizations:
path Parameters
petId required | integer <int64> ID of pet to return |
Responses
Response samples
- 200
{- "id": 0,
- "category": {
- "id": 0,
- "name": "string"
}, - "name": "doggie",
- "photoUrls": [
- "string"
], - "tags": [
- {
- "id": 0,
- "name": "string"
}
], - "status": "available"
}
Updates a pet in the store with form data
Authorizations:
write:pets
read:pets
path Parameters
petId required | integer <int64> ID of pet that needs to be updated |
Request Body schema: application/x-www-form-urlencoded
name | string Updated name of the pet |
status | string Updated status of the pet |
Responses
Deletes a pet
Authorizations:
write:pets
read:pets
path Parameters
petId required | integer <int64> Pet id to delete |
header Parameters
api_key | string |
Responses
Place an order for a pet
Request Body schema: application/json
order placed for purchasing the pet
id | integer <int64> |
petId | integer <int64> |
quantity | integer <int32> |
shipDate | string <date-time> |
status | string Enum: "placed" "approved" "delivered" Order Status |
complete | boolean |
Responses
Request samples
- Payload
{- "id": 0,
- "petId": 0,
- "quantity": 0,
- "shipDate": "2019-08-24T14:15:22Z",
- "status": "placed",
- "complete": true
}
Response samples
- 200
{- "id": 0,
- "petId": 0,
- "quantity": 0,
- "shipDate": "2019-08-24T14:15:22Z",
- "status": "placed",
- "complete": true
}
Find purchase order by ID
For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions
path Parameters
orderId required | integer <int64> [ 1 .. 10 ] ID of pet that needs to be fetched |
Responses
Response samples
- 200
{- "id": 0,
- "petId": 0,
- "quantity": 0,
- "shipDate": "2019-08-24T14:15:22Z",
- "status": "placed",
- "complete": true
}
Creates list of users with given input array
Request Body schema: application/json
List of user object
id | integer <int64> |
username | string |
firstName | string |
lastName | string |
string | |
password | string |
phone | string |
userStatus | integer <int32> User Status |
Responses
Request samples
- Payload
[- {
- "id": 0,
- "username": "string",
- "firstName": "string",
- "lastName": "string",
- "email": "string",
- "password": "string",
- "phone": "string",
- "userStatus": 0
}
]
Creates list of users with given input array
Request Body schema: application/json
List of user object
id | integer <int64> |
username | string |
firstName | string |
lastName | string |
string | |
password | string |
phone | string |
userStatus | integer <int32> User Status |
Responses
Request samples
- Payload
[- {
- "id": 0,
- "username": "string",
- "firstName": "string",
- "lastName": "string",
- "email": "string",
- "password": "string",
- "phone": "string",
- "userStatus": 0
}
]
Get user by user name
path Parameters
username required | string The name that needs to be fetched. Use user1 for testing. |
Responses
Response samples
- 200
{- "id": 0,
- "username": "string",
- "firstName": "string",
- "lastName": "string",
- "email": "string",
- "password": "string",
- "phone": "string",
- "userStatus": 0
}
Updated user
This can only be done by the logged in user.
path Parameters
username required | string name that need to be updated |
Request Body schema: application/json
Updated user object
id | integer <int64> |
username | string |
firstName | string |
lastName | string |
string | |
password | string |
phone | string |
userStatus | integer <int32> User Status |
Responses
Request samples
- Payload
{- "id": 0,
- "username": "string",
- "firstName": "string",
- "lastName": "string",
- "email": "string",
- "password": "string",
- "phone": "string",
- "userStatus": 0
}
Create user
This can only be done by the logged in user.
Request Body schema: application/json
Created user object
id | integer <int64> |
username | string |
firstName | string |
lastName | string |
string | |
password | string |
phone | string |
userStatus | integer <int32> User Status |
Responses
Request samples
- Payload
{- "id": 0,
- "username": "string",
- "firstName": "string",
- "lastName": "string",
- "email": "string",
- "password": "string",
- "phone": "string",
- "userStatus": 0
}