OpenAPI Petstore
This is a sample server Petstore server. For this sample, you can use the api key special-key
to test the authorization filters.
Version: 1.0.0
BasePath:/v2
Apache-2.0
https://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:
[ Jump to Models ]
Table of Contents
Add a new pet to the store (addPet)
Consumes
This API call consumes the following media types via the request header:
application/json
application/xml
Request body
Return type
Example data
Content-Type: application/json
{
"photoUrls" : [ "photoUrls", "photoUrls" ],
"name" : "doggie",
"id" : 0,
"category" : {
"name" : "name",
"id" : 6
},
"tags" : [ {
"name" : "name",
"id" : 1
}, {
"name" : "name",
"id" : 1
} ],
"status" : "available"
}
Example data
Content-Type: application/xml
123456789
doggie
aeiou
aeiou
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
application/xml
application/json
Responses
200
successful operation
Pet
405
Invalid input
Deletes a pet (deletePet)
Path parameters
petId (required)
Path Parameter — Pet id to delete default: null format: int64
Request headers
api_key (optional)
Header Parameter — default: null
Responses
400
Invalid pet value
Finds Pets by status (findPetsByStatus)
Multiple status values can be provided with comma separated strings
Query parameters
status (required)
Query Parameter — Status values that need to be considered for filter default: null
Return type
Example data
Content-Type: application/json
{
"photoUrls" : [ "photoUrls", "photoUrls" ],
"name" : "doggie",
"id" : 0,
"category" : {
"name" : "name",
"id" : 6
},
"tags" : [ {
"name" : "name",
"id" : 1
}, {
"name" : "name",
"id" : 1
} ],
"status" : "available"
}
Example data
Content-Type: application/xml
123456789
doggie
aeiou
aeiou
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
application/xml
application/json
Responses
200
successful operation
400
Invalid status value
Finds Pets by tags (findPetsByTags)
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Query parameters
tags (required)
Query Parameter — Tags to filter by default: null
Return type
Example data
Content-Type: application/json
{
"photoUrls" : [ "photoUrls", "photoUrls" ],
"name" : "doggie",
"id" : 0,
"category" : {
"name" : "name",
"id" : 6
},
"tags" : [ {
"name" : "name",
"id" : 1
}, {
"name" : "name",
"id" : 1
} ],
"status" : "available"
}
Example data
Content-Type: application/xml
123456789
doggie
aeiou
aeiou
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
application/xml
application/json
Responses
200
successful operation
400
Invalid tag value
Find pet by ID (getPetById)
Returns a single pet
Path parameters
petId (required)
Path Parameter — ID of pet to return default: null format: int64
Return type
Example data
Content-Type: application/json
{
"photoUrls" : [ "photoUrls", "photoUrls" ],
"name" : "doggie",
"id" : 0,
"category" : {
"name" : "name",
"id" : 6
},
"tags" : [ {
"name" : "name",
"id" : 1
}, {
"name" : "name",
"id" : 1
} ],
"status" : "available"
}
Example data
Content-Type: application/xml
123456789
doggie
aeiou
aeiou
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
application/xml
application/json
Responses
200
successful operation
Pet
400
Invalid ID supplied
404
Pet not found
Update an existing pet (updatePet)
Consumes
This API call consumes the following media types via the request header:
application/json
application/xml
Request body
Return type
Example data
Content-Type: application/json
{
"photoUrls" : [ "photoUrls", "photoUrls" ],
"name" : "doggie",
"id" : 0,
"category" : {
"name" : "name",
"id" : 6
},
"tags" : [ {
"name" : "name",
"id" : 1
}, {
"name" : "name",
"id" : 1
} ],
"status" : "available"
}
Example data
Content-Type: application/xml
123456789
doggie
aeiou
aeiou
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
application/xml
application/json
Responses
200
successful operation
Pet
400
Invalid ID supplied
404
Pet not found
405
Validation exception
Updates a pet in the store with form data (updatePetWithForm)
Path parameters
petId (required)
Path Parameter — ID of pet that needs to be updated default: null format: int64
Consumes
This API call consumes the following media types via the request header:
application/x-www-form-urlencoded
Form parameters
name (optional)
Form Parameter — Updated name of the pet default: null
status (optional)
Form Parameter — Updated status of the pet default: null
Responses
405
Invalid input
Up
post /pet/{petId}/uploadImage
uploads an image (uploadFile)
Path parameters
petId (required)
Path Parameter — ID of pet to update default: null format: int64
Consumes
This API call consumes the following media types via the request header:
Form parameters
additionalMetadata (optional)
Form Parameter — Additional data to pass to server default: null
file (optional)
Form Parameter — file to upload default: null format: binary
Return type
Example data
Content-Type: application/json
{
"code" : 0,
"type" : "type",
"message" : "message"
}
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
successful operation
ApiResponse
Up
delete /store/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 default: null
Responses
400
Invalid ID supplied
404
Order not found
Returns pet inventories by status (getInventory)
Returns a map of status codes to quantities
Return type
map[String, Integer]
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
Responses
200
successful operation
Up
get /store/order/{orderId}
Find purchase order by ID (getOrderById)
For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions
Path parameters
orderId (required)
Path Parameter — ID of pet that needs to be fetched default: null format: int64
Return type
Example data
Content-Type: application/json
{
"petId" : 6,
"quantity" : 1,
"id" : 0,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"complete" : false,
"status" : "placed"
}
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 request header;
the media type will be conveyed by the response header.
application/xml
application/json
Responses
200
successful operation
Order
400
Invalid ID supplied
404
Order not found
Place an order for a pet (placeOrder)
Consumes
This API call consumes the following media types via the request header:
Request body
Return type
Example data
Content-Type: application/json
{
"petId" : 6,
"quantity" : 1,
"id" : 0,
"shipDate" : "2000-01-23T04:56:07.000+00:00",
"complete" : false,
"status" : "placed"
}
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 request header;
the media type will be conveyed by the response header.
application/xml
application/json
Responses
200
successful operation
Order
400
Invalid Order
Create user (createUser)
This can only be done by the logged in user.
Consumes
This API call consumes the following media types via the request header:
Request body
Responses
default
successful operation
Up
post /user/createWithArray
Creates list of users with given input array (createUsersWithArrayInput)
Consumes
This API call consumes the following media types via the request header:
Request body
Responses
default
successful operation
Up
post /user/createWithList
Creates list of users with given input array (createUsersWithListInput)
Consumes
This API call consumes the following media types via the request header:
Request body
Responses
default
successful operation
Up
delete /user/{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 default: null
Responses
400
Invalid username supplied
404
User not found
Get user by user name (getUserByName)
Path parameters
username (required)
Path Parameter — The name that needs to be fetched. Use user1 for testing. default: null
Return type
Example data
Content-Type: application/json
{
"firstName" : "firstName",
"lastName" : "lastName",
"password" : "password",
"userStatus" : 6,
"phone" : "phone",
"id" : 0,
"email" : "email",
"username" : "username"
}
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 request header;
the media type will be conveyed by the response header.
application/xml
application/json
Responses
200
successful operation
User
400
Invalid username supplied
404
User not found
Logs user into the system (loginUser)
Query parameters
username (required)
Query Parameter — The user name for login default: null
password (required)
Query Parameter — The password for login in clear text default: null
Return type
String
Produces
This API call produces the following media types according to the request header;
the media type will be conveyed by the response header.
application/xml
application/json
Responses
200
successful operation
String
400
Invalid username/password supplied
Logs out current logged in user session (logoutUser)
Responses
default
successful operation
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 default: null
Consumes
This API call consumes the following media types via the request header:
Request body
Responses
400
Invalid user supplied
404
User not found
[ Jump to Methods ]
Table of Contents
ApiResponse
- An uploaded response
Category
- Pet category
Order
- Pet Order
Pet
- a Pet
Tag
- Pet Tag
User
- a User
Describes the result of uploading an image resource
code (optional)
type (optional)
message (optional)
A category for a pet
id (optional)
name (optional)
An order for a pets from the pet store
id (optional)
petId (optional)
quantity (optional)
shipDate (optional)
status (optional)
placed
approved
delivered
complete (optional)
A pet for sale in the pet store
id (optional)
category (optional)
name
photoUrls
tags (optional)
status (optional)
String pet status in the store
available
pending
sold
A tag for a pet
id (optional)
name (optional)
A User who is purchasing from the pet store
id (optional)
username (optional)
firstName (optional)
lastName (optional)
email (optional)
password (optional)
phone (optional)
userStatus (optional)