NAV

Swagger Petstore

General Information

Version 1.0.0

Schemes

http

Host & base path

petstore.swagger.io/v2/

Terms of Service

http://swagger.io/terms/

External resources

Find out more about Swagger

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.

List of API Calls

pet

POST /v2/pet

GET /v2/pet/findByStatus

GET /v2/pet/findByTags

GET /v2/pet/{petId}

POST /v2/pet/{petId}

POST /v2/pet/{petId}/uploadImage

store

GET /v2/store/inventory

POST /v2/store/order

GET /v2/store/order/{orderId}

user

POST /v2/user

POST /v2/user/createWithArray

POST /v2/user/createWithList

GET /v2/user/login

GET /v2/user/logout

GET /v2/user/{username}

pet

## Add a new pet to the store

POST /v2/pet

Parameters

Parameter Description Type In

body
required

Pet object that needs to be added to the store

body

Responses

Code Description
405

Invalid input

## Finds Pets by status

GET /v2/pet/findByStatus

Multiple status values can be provided with comma separated strings

Parameters

Parameter Description Type In

status
required

Status values that need to be considered for filter

array

query

Responses

Code Description
200

successful operation

400

Invalid status value

## Finds Pets by tags

GET /v2/pet/findByTags

Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

Parameters

Parameter Description Type In

tags
required

Tags to filter by

array

query

Responses

Code Description
200

successful operation

400

Invalid tag value

## Find pet by ID

GET /v2/pet/{petId}

Returns a single pet

Parameters

Parameter Description Type In

petId
required

ID of pet to return

integer
int64

path

Responses

Code Description
200

successful operation

400

Invalid ID supplied

404

Pet not found

## Updates a pet in the store with form data

POST /v2/pet/{petId}

Parameters

Parameter Description Type In

petId
required

ID of pet that needs to be updated

integer
int64

path

name
optional

Updated name of the pet

string

formData

status
optional

Updated status of the pet

string

formData

Responses

Code Description
405

Invalid input

## uploads an image

POST /v2/pet/{petId}/uploadImage

Parameters

Parameter Description Type In

petId
required

ID of pet to update

integer
int64

path

additionalMetadata
optional

Additional data to pass to server

string

formData

file
optional

file to upload

file

formData

Responses

Code Description
200

successful operation

store

## Returns pet inventories by status

GET /v2/store/inventory

Returns a map of status codes to quantities

Parameters

Parameter Description Type In

Responses

Code Description
200

successful operation

## Place an order for a pet

POST /v2/store/order

Parameters

Parameter Description Type In

body
required

order placed for purchasing the pet

body

Responses

Code Description
200

successful operation

400

Invalid Order

## Find purchase order by ID

GET /v2/store/order/{orderId}

For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions

Parameters

Parameter Description Type In

orderId
required

ID of pet that needs to be fetched

integer
int64

path

Responses

Code Description
200

successful operation

400

Invalid ID supplied

404

Order not found

user

## Create user

POST /v2/user

This can only be done by the logged in user.

Parameters

Parameter Description Type In

body
required

Created user object

body

Responses

Code Description
default

successful operation

## Creates list of users with given input array

POST /v2/user/createWithArray

Parameters

Parameter Description Type In

body
required

List of user object

body

Responses

Code Description
default

successful operation

## Creates list of users with given input array

POST /v2/user/createWithList

Parameters

Parameter Description Type In

body
required

List of user object

body

Responses

Code Description
default

successful operation

## Logs user into the system

GET /v2/user/login

Parameters

Parameter Description Type In

username
required

The user name for login

string

query

password
required

The password for login in clear text

string

query

Responses

Code Description
200

successful operation

400

Invalid username/password supplied

## Logs out current logged in user session

GET /v2/user/logout

Parameters

Parameter Description Type In

Responses

Code Description
default

successful operation

## Get user by user name

GET /v2/user/{username}

Parameters

Parameter Description Type In

username
required

The name that needs to be fetched. Use user1 for testing.

string

path

Responses

Code Description
200

successful operation

400

Invalid username supplied

404

User not found

Responses

Definitions

(object)

This object has the following properties:

id (integer)

petId (integer)

quantity (integer)

shipDate (string)

status (string, enum)

Order Status

This element must be one of the following enum values:

  • placed
  • approved
  • delivered

complete (boolean)

Default: false

(object)

This object has the following properties:

id (integer)

name (string)

(object)

This object has the following properties:

id (integer)

username (string)

firstName (string)

lastName (string)

email (string)

password (string)

phone (string)

userStatus (integer)

User Status

(object)

This object has the following properties:

id (integer)

name (string)

(object)

This object has the following properties:

id (integer)

category (object)

The category object has the following properties:

id (integer)

name (string)

name (string, required)

photoUrls (array, required)

All array elements must be of type:

(string)

tags (array)

All array elements must be of type:

(object)

This object has the following properties:

id (integer)
name (string)

status (string, enum)

pet status in the store

This element must be one of the following enum values:

  • available
  • pending
  • sold

(object)

This object has the following properties:

code (integer)

type (string)

message (string)