Swagger Petstore

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
Contact Info: apiteam@swagger.io
Version: 1.0.0
Apache 2.0
http://www.apache.org/licenses/LICENSE-2.0.html

Access

Methods

[ Jump to Models ]

Table of Contents

  1. put /pet
  2. post /pet
  3. get /pet/findByStatus
  4. get /pet/findByTags
  5. get /pet/{petId}
  6. post /pet/{petId}
  7. delete /pet/{petId}
  8. post /pet/{petId}/uploadImage
  9. get /store/inventory
  10. post /store/order
  11. get /store/order/{orderId}
  12. delete /store/order/{orderId}
  13. post /user
  14. post /user/createWithArray
  15. post /user/createWithList
  16. get /user/login
  17. get /user/logout
  18. get /user/{username}
  19. put /user/{username}
  20. delete /user/{username}
Up
put /pet
Update an existing pet (updatePet)

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

body (optional)
Body Parameter — Pet object that needs to be added to the store

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

400

Invalid ID supplied

404

Pet not found

405

Validation exception

Up
post /pet
Add a new pet to the store (addPet)

Consumes

This API call consumes the following media types via the Content-Type request header:

Request body

body (optional)
Body Parameter — Pet object that needs to be added to the store

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

405

Invalid input

Up
get /pet/findByStatus
Finds Pets by status (findPetsByStatus)
Multiple status values can be provided with comma seperated strings

Query parameters

status (optional)
Query Parameter — Status values that need to be considered for filter default: available

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

successful operation

400

Invalid status value

Up
get /pet/findByTags
Finds Pets by tags (findPetsByTags)
Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.

Query parameters

tags (optional)
Query Parameter — Tags to filter by

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

successful operation

400

Invalid tag value

Up
get /pet/{petId}
Find pet by ID (getPetById)
Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions

Path parameters

petId (required)
Path Parameter — ID of pet that needs to be fetched

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

successful operation

400

Invalid ID supplied

404

Pet not found

Up
post /pet/{petId}
Updates a pet in the store with form data (updatePetWithForm)

Path parameters

petId (required)
Path Parameter — ID of pet that needs to be updated

Consumes

This API call consumes the following media types via the Content-Type request header:

Form parameters

name (optional)
Form Parameter — Updated name of the pet
status (optional)
Form Parameter — Updated status of the pet

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

405

Invalid input

Up
delete /pet/{petId}
Deletes a pet (deletePet)

Path parameters

petId (required)
Path Parameter — Pet id to delete

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

400

Invalid pet value

Up
post /pet/{petId}/uploadImage
uploads an image (uploadFile)

Path parameters

petId (required)
Path Parameter — ID of pet to update

Consumes

This API call consumes the following media types via the Content-Type request header:

Form parameters

additionalMetadata (optional)
Form Parameter — Additional data to pass to server
file (optional)
Form Parameter — file to upload

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

0

successful operation

Up
get /store/inventory
Returns pet inventories by status (getInventory)
Returns a map of status codes to quantities

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

successful operation

Up
post /store/order
Place an order for a pet (placeOrder)

Request body

body (optional)
Body Parameter — order placed for purchasing the pet

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

successful operation

400

Invalid Order

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 generated exceptions

Path parameters

orderId (required)
Path Parameter — ID of pet that needs to be fetched

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

successful operation

400

Invalid ID supplied

404

Order not found

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

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

400

Invalid ID supplied

404

Order not found

Up
post /user
Create user (createUser)
This can only be done by the logged in user.

Request body

body (optional)
Body Parameter — Created user object

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

0

successful operation

Up
post /user/createWithArray
Creates list of users with given input array (createUsersWithArrayInput)

Request body

body (optional)
Body Parameter — List of user object

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

0

successful operation

Up
post /user/createWithList
Creates list of users with given input array (createUsersWithListInput)

Request body

body (optional)
Body Parameter — List of user object

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

0

successful operation

Up
get /user/login
Logs user into the system (loginUser)

Query parameters

username (optional)
Query Parameter — The user name for login
password (optional)
Query Parameter — The password for login in clear text

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

successful operation

400

Invalid username/password supplied

Up
get /user/logout
Logs out current logged in user session (logoutUser)

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

0

successful operation

Up
get /user/{username}
Get user by user name (getUserByName)

Path parameters

username (required)
Path Parameter — The name that needs to be fetched. Use user1 for testing.

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

200

successful operation

Example data

Content-Type: application/json
{id=1, username=johnp, firstName=John, lastName=Public, email=johnp@swagger.io, password=-secret-, phone=0123456789, userStatus=0}

400

Invalid username supplied

404

User not found

Up
put /user/{username}
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

Request body

body (optional)
Body Parameter — Updated user object

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

400

Invalid user supplied

404

User not found

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

Produces

This API call produces the following media types according to the Accept request header; the media type will be conveyed by the Content-Type response header.

Responses

400

Invalid username supplied

404

User not found

Up

Models

[ Jump to Methods ]

Table of Contents

  1. User
  2. Category
  3. Pet
  4. Tag
  5. Order

User Up

id
Long
username
String
firstName
String
lastName
String
email
String
password
String
phone
String
userStatus
Integer User Status

Category Up

id
Long
name
String

Pet Up

id
Long
category
Category
name
String
photoUrls
array[String]
tags
array[Tag]
status
String pet status in the store
Enum:
available
pending
sold

Tag Up

id
Long
name
String

Order Up

id
Long
petId
Long
quantity
Integer
shipDate
Date
status
String Order Status
Enum:
placed
approved
delivered
complete
Boolean