Swagger Petstore

This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). 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
BasePath:/v2
Apache 2.0
http://www.apache.org/licenses/LICENSE-2.0.html

Access

  1. OAuth AuthorizationUrl:http://petstore.swagger.io/oauth/dialogTokenUrl:
  2. APIKey KeyParamName:api_key KeyInQuery:false KeyInHeader:true

Methods

[ Jump to Models ]

Table of Contents

  1. post /pet
  2. delete /pet/{petId}
  3. get /pet/findByStatus
  4. get /pet/findByTags
  5. get /pet/{petId}
  6. put /pet
  7. post /pet/{petId}
  8. post /pet/{petId}/uploadImage
  9. delete /store/order/{orderId}
  10. get /store/inventory
  11. get /store/order/{orderId}
  12. post /store/order
  13. post /user
  14. post /user/createWithArray
  15. post /user/createWithList
  16. delete /user/{username}
  17. get /user/{username}
  18. get /user/login
  19. get /user/logout
  20. put /user/{username}
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 (required)
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
delete /pet/{petId}
Deletes a pet (deletePet)

Path parameters

petId (required)
Path Parameter — Pet id to delete format: int64

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

Up
get /pet/findByStatus
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

Return type

array[Pet]

Example data

Content-Type: application/xml

  123456
  doggie
  
    string
  
  
  
  string

Example data

Content-Type: application/json
[ {
  "photoUrls" : [ "aeiou" ],
  "name" : "doggie",
  "id" : 123456789,
  "category" : {
    "name" : "aeiou",
    "id" : 123456789
  },
  "tags" : [ {
    "name" : "aeiou",
    "id" : 123456789
  } ],
  "status" : "aeiou"
} ]

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 separated strings. Use tag1, tag2, tag3 for testing.

Query parameters

tags (required)
Query Parameter — Tags to filter by

Return type

array[Pet]

Example data

Content-Type: application/xml

  123456
  doggie
  
    string
  
  
  
  string

Example data

Content-Type: application/json
[ {
  "photoUrls" : [ "aeiou" ],
  "name" : "doggie",
  "id" : 123456789,
  "category" : {
    "name" : "aeiou",
    "id" : 123456789
  },
  "tags" : [ {
    "name" : "aeiou",
    "id" : 123456789
  } ],
  "status" : "aeiou"
} ]

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 single pet

Path parameters

petId (required)
Path Parameter — ID of pet to return format: int64

Return type

Pet

Example data

Content-Type: application/xml

  123456
  doggie
  
    string
  
  
  
  string

Example data

Content-Type: application/json
{
  "photoUrls" : [ "aeiou" ],
  "name" : "doggie",
  "id" : 123456789,
  "category" : {
    "name" : "aeiou",
    "id" : 123456789
  },
  "tags" : [ {
    "name" : "aeiou",
    "id" : 123456789
  } ],
  "status" : "aeiou"
}

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 Pet

400

Invalid ID supplied

404

Pet not found

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 (required)
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/{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 format: int64

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
post /pet/{petId}/uploadImage
uploads an image (uploadFile)

Path parameters

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

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

Return type

ApiResponse

Example data

Content-Type: application/json
{
  "code" : 123,
  "type" : "aeiou",
  "message" : "aeiou"
}

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 ApiResponse

Up
delete /store/order/{orderId}
Delete purchase order by ID (deleteOrder)
For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors

Path parameters

orderId (required)
Path Parameter — ID of the order that needs to be deleted format: int64

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
get /store/inventory
Returns pet inventories by status (getInventory)
Returns a map of status codes to quantities

Return type

map[String, Integer]

Example data

Content-Type: application/json
{
  "key" : 123
}

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
get /store/order/{orderId}
Find purchase order by ID (getOrderById)
For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions

Path parameters

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

Return type

Order

Example data

Content-Type: application/xml

  123456
  123456
  0
  2000-01-23T04:56:07.000Z
  string
  true

Example data

Content-Type: application/json
{
  "petId" : 123456789,
  "quantity" : 123,
  "id" : 123456789,
  "shipDate" : "2000-01-23T04:56:07.000+00:00",
  "complete" : true,
  "status" : "aeiou"
}

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 Order

400

Invalid ID supplied

404

Order not found

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

Request body

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

Return type

Order

Example data

Content-Type: application/xml

  123456
  123456
  0
  2000-01-23T04:56:07.000Z
  string
  true

Example data

Content-Type: application/json
{
  "petId" : 123456789,
  "quantity" : 123,
  "id" : 123456789,
  "shipDate" : "2000-01-23T04:56:07.000+00:00",
  "complete" : true,
  "status" : "aeiou"
}

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 Order

400

Invalid Order

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

Request body

body (required)
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 (required)
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 (required)
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
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
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.

Return type

User

Example data

Content-Type: application/xml

  123456
  string
  string
  string
  string
  string
  string
  0

Example data

Content-Type: application/json
{
  "firstName" : "aeiou",
  "lastName" : "aeiou",
  "password" : "aeiou",
  "userStatus" : 123,
  "phone" : "aeiou",
  "id" : 123456789,
  "email" : "aeiou",
  "username" : "aeiou"
}

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 User

400

Invalid username supplied

404

User not found

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

Query parameters

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

Return type

String

Example data

Content-Type: application/xml
string

Example data

Content-Type: application/json
"aeiou"

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 String

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
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 updated

Request body

body (required)
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

Models

[ Jump to Methods ]

Table of Contents

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

ApiResponse Up

code (optional)
Integer format: int32
type (optional)
message (optional)

Category Up

id (optional)
Long format: int64
name (optional)

Order Up

id (optional)
Long format: int64
petId (optional)
Long format: int64
quantity (optional)
Integer format: int32
shipDate (optional)
Date format: date-time
status (optional)
String Order Status
Enum:
placed
approved
delivered
complete (optional)

Pet Up

id (optional)
Long format: int64
category (optional)
name
photoUrls
tags (optional)
status (optional)
String pet status in the store
Enum:
available
pending
sold

Tag Up

id (optional)
Long format: int64
name (optional)

User Up

id (optional)
Long format: int64
username (optional)
firstName (optional)
lastName (optional)
email (optional)
password (optional)
phone (optional)
userStatus (optional)
Integer User Status format: int32