Swagger Petstore 1.0.0
Produces
Schemes: http
Host: petstore.swagger.io
Base path: /v2
Authorization: petstore_auth
Authorization: api_key
Type |
Name |
In |
Description |
apiKey |
api_key |
header |
|
Pet
Add a new pet to the store
POST /v2/pet HTTP/1.1
Content-Type: application/json
{
"body": {
"id": "integer",
"category": {
"id": "integer",
"name": "string"
},
"name": "string",
"photoUrls": [
"string"
],
"tags": [
{
"id": "integer",
"name": "string"
}
],
"status": "string"
}
}
HTTP/1.1 405 Method Not Allowed
Parameters
Name |
In |
Type |
Description |
body * |
body |
Pet |
Pet object that needs to be added to the store |
Responses
Http code |
Type |
Description |
405 |
no content |
Invalid input |
Update an existing pet
PUT /v2/pet HTTP/1.1
Content-Type: application/json
{
"body": {
"id": "integer",
"category": {
"id": "integer",
"name": "string"
},
"name": "string",
"photoUrls": [
"string"
],
"tags": [
{
"id": "integer",
"name": "string"
}
],
"status": "string"
}
}
HTTP/1.1 400 Bad Request
HTTP/1.1 404 Not Found
HTTP/1.1 405 Method Not Allowed
Parameters
Name |
In |
Type |
Description |
body * |
body |
Pet |
Pet object that needs to be added to the store |
Responses
Http code |
Type |
Description |
400 |
no content |
Invalid ID supplied |
404 |
no content |
Pet not found |
405 |
no content |
Validation exception |
Finds Pets by status
GET /v2/pet/findByStatus HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": "integer",
"category": {
"id": "integer",
"name": "string"
},
"name": "string",
"photoUrls": [
"string"
],
"tags": [
{
"id": "integer",
"name": "string"
}
],
"status": "string"
}
]
HTTP/1.1 400 Bad Request
Multiple status values can be provided with comma separated strings
Parameters
Name |
In |
Type |
Description |
status * |
query |
array[string] |
Status values that need to be considered for filter |
Responses
Http code |
Type |
Description |
200 |
array[Pet] |
successful operation |
400 |
no content |
Invalid status value |
GET /v2/pet/findByTags HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
[
{
"id": "integer",
"category": {
"id": "integer",
"name": "string"
},
"name": "string",
"photoUrls": [
"string"
],
"tags": [
{
"id": "integer",
"name": "string"
}
],
"status": "string"
}
]
HTTP/1.1 400 Bad Request
Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
Parameters
Name |
In |
Type |
Description |
tags * |
query |
array[string] |
Tags to filter by |
Responses
Http code |
Type |
Description |
200 |
array[Pet] |
successful operation |
400 |
no content |
Invalid tag value |
Find pet by ID
GET /v2/pet/{petId} HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "integer",
"category": {
"id": "integer",
"name": "string"
},
"name": "string",
"photoUrls": [
"string"
],
"tags": [
{
"id": "integer",
"name": "string"
}
],
"status": "string"
}
HTTP/1.1 400 Bad Request
HTTP/1.1 404 Not Found
Returns a single pet
Parameters
Name |
In |
Type |
Description |
petId * |
path |
integer |
ID of pet to return |
Responses
Http code |
Type |
Description |
200 |
Pet |
successful operation |
400 |
no content |
Invalid ID supplied |
404 |
no content |
Pet not found |
POST /v2/pet/{petId} HTTP/1.1
HTTP/1.1 405 Method Not Allowed
Parameters
Name |
In |
Type |
Description |
petId * |
path |
integer |
ID of pet that needs to be updated |
name |
formData |
string |
Optional. Updated name of the pet |
status |
formData |
string |
Optional. Updated status of the pet |
Responses
Http code |
Type |
Description |
405 |
no content |
Invalid input |
Deletes a pet
DELETE /v2/pet/{petId} HTTP/1.1
api_key: string
HTTP/1.1 400 Bad Request
HTTP/1.1 404 Not Found
Parameters
Name |
In |
Type |
Description |
api_key |
header |
string |
Optional. |
petId * |
path |
integer |
Pet id to delete |
Responses
Http code |
Type |
Description |
400 |
no content |
Invalid ID supplied |
404 |
no content |
Pet not found |
uploads an image
POST /v2/pet/{petId}/uploadImage HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"code": "integer",
"type": "string",
"message": "string"
}
Parameters
Name |
In |
Type |
Description |
petId * |
path |
integer |
ID of pet to update |
additionalMetadata |
formData |
string |
Optional. Additional data to pass to server |
file |
formData |
file |
Optional. file to upload |
Responses
Http code |
Type |
Description |
200 |
ApiResponse |
successful operation |
Store
Returns pet inventories by status
GET /v2/store/inventory HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
"object"
Returns a map of status codes to quantities
Responses
Http code |
Type |
Description |
200 |
object |
successful operation |
Place an order for a pet
POST /v2/store/order HTTP/1.1
Content-Type: application/json
{
"body": {
"id": "integer",
"petId": "integer",
"quantity": "integer",
"shipDate": "string",
"status": "string",
"complete": "boolean"
}
}
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "integer",
"petId": "integer",
"quantity": "integer",
"shipDate": "string",
"status": "string",
"complete": "boolean"
}
HTTP/1.1 400 Bad Request
Parameters
Name |
In |
Type |
Description |
body * |
body |
Order |
order placed for purchasing the pet |
Responses
Http code |
Type |
Description |
200 |
Order |
successful operation |
400 |
no content |
Invalid Order |
Find purchase order by ID
GET /v2/store/order/{orderId} HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "integer",
"petId": "integer",
"quantity": "integer",
"shipDate": "string",
"status": "string",
"complete": "boolean"
}
HTTP/1.1 400 Bad Request
HTTP/1.1 404 Not Found
For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions
Parameters
Name |
In |
Type |
Description |
orderId * |
path |
integer |
ID of pet that needs to be fetched |
Responses
Http code |
Type |
Description |
200 |
Order |
successful operation |
400 |
no content |
Invalid ID supplied |
404 |
no content |
Order not found |
Delete purchase order by ID
DELETE /v2/store/order/{orderId} HTTP/1.1
HTTP/1.1 400 Bad Request
HTTP/1.1 404 Not Found
For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors
Parameters
Name |
In |
Type |
Description |
orderId * |
path |
integer |
ID of the order that needs to be deleted |
Responses
Http code |
Type |
Description |
400 |
no content |
Invalid ID supplied |
404 |
no content |
Order not found |
User
Create user
POST /v2/user HTTP/1.1
Content-Type: application/json
{
"body": {
"id": "integer",
"username": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"password": "string",
"phone": "string",
"userStatus": "integer"
}
}
HTTP/1.1 [default]
This can only be done by the logged in user.
Parameters
Name |
In |
Type |
Description |
body * |
body |
User |
Created user object |
Responses
Http code |
Type |
Description |
default |
no content |
successful operation |
POST /v2/user/createWithArray HTTP/1.1
Content-Type: application/json
{
"body": [
{
"id": "integer",
"username": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"password": "string",
"phone": "string",
"userStatus": "integer"
}
]
}
HTTP/1.1 [default]
Parameters
Name |
In |
Type |
Description |
body * |
body |
array[User] |
List of user object |
Responses
Http code |
Type |
Description |
default |
no content |
successful operation |
POST /v2/user/createWithList HTTP/1.1
Content-Type: application/json
{
"body": [
{
"id": "integer",
"username": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"password": "string",
"phone": "string",
"userStatus": "integer"
}
]
}
HTTP/1.1 [default]
Parameters
Name |
In |
Type |
Description |
body * |
body |
array[User] |
List of user object |
Responses
Http code |
Type |
Description |
default |
no content |
successful operation |
Logs user into the system
GET /v2/user/login HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
"string"
HTTP/1.1 400 Bad Request
Parameters
Name |
In |
Type |
Description |
username * |
query |
string |
The user name for login |
password * |
query |
string |
The password for login in clear text |
Responses
Http code |
Type |
Description |
200 |
string |
successful operation |
400 |
no content |
Invalid username/password supplied |
Logs out current logged in user session
GET /v2/user/logout HTTP/1.1
HTTP/1.1 [default]
Responses
Http code |
Type |
Description |
default |
no content |
successful operation |
Get user by user name
GET /v2/user/{username} HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": "integer",
"username": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"password": "string",
"phone": "string",
"userStatus": "integer"
}
HTTP/1.1 400 Bad Request
HTTP/1.1 404 Not Found
Parameters
Name |
In |
Type |
Description |
username * |
path |
string |
The name that needs to be fetched. Use user1 for testing. |
Responses
Http code |
Type |
Description |
200 |
User |
successful operation |
400 |
no content |
Invalid username supplied |
404 |
no content |
User not found |
Updated user
PUT /v2/user/{username} HTTP/1.1
Content-Type: application/json
{
"body": {
"id": "integer",
"username": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"password": "string",
"phone": "string",
"userStatus": "integer"
}
}
HTTP/1.1 400 Bad Request
HTTP/1.1 404 Not Found
This can only be done by the logged in user.
Parameters
Name |
In |
Type |
Description |
username * |
path |
string |
name that need to be updated |
body * |
body |
User |
Updated user object |
Responses
Http code |
Type |
Description |
400 |
no content |
Invalid user supplied |
404 |
no content |
User not found |
Delete user
DELETE /v2/user/{username} HTTP/1.1
HTTP/1.1 400 Bad Request
HTTP/1.1 404 Not Found
This can only be done by the logged in user.
Parameters
Name |
In |
Type |
Description |
username * |
path |
string |
The name that needs to be deleted |
Responses
Http code |
Type |
Description |
400 |
no content |
Invalid username supplied |
404 |
no content |
User not found |
Models
Order
{
"id": "integer",
"petId": "integer",
"quantity": "integer",
"shipDate": "string",
"status": "string",
"complete": "boolean"
}
Fields
Name |
Type |
Format |
Description |
id |
integer |
int64 |
|
petId |
integer |
int64 |
|
quantity |
integer |
int32 |
|
shipDate |
string |
date-time |
|
status |
string |
|
|
Acceptable values:
placed
approved
delivered
| Order Status
complete | boolean | |
Category
{
"id": "integer",
"name": "string"
}
Fields
Name |
Type |
Format |
Description |
id |
integer |
int64 |
|
name |
string |
|
|
User
{
"id": "integer",
"username": "string",
"firstName": "string",
"lastName": "string",
"email": "string",
"password": "string",
"phone": "string",
"userStatus": "integer"
}
Fields
Name |
Type |
Format |
Description |
id |
integer |
int64 |
|
username |
string |
|
|
firstName |
string |
|
|
lastName |
string |
|
|
email |
string |
|
|
password |
string |
|
|
phone |
string |
|
|
userStatus |
integer |
int32 |
User Status |
Tag
{
"id": "integer",
"name": "string"
}
Fields
Name |
Type |
Format |
Description |
id |
integer |
int64 |
|
name |
string |
|
|
Pet
{
"id": "integer",
"category": {
"id": "integer",
"name": "string"
},
"name": "string",
"photoUrls": [
"string"
],
"tags": [
{
"id": "integer",
"name": "string"
}
],
"status": "string"
}
Fields
Name |
Type |
Format |
Description |
id |
integer |
int64 |
|
category |
Category |
|
|
name * |
string |
|
|
photoUrls * |
array[string] |
|
|
tags |
array[Tag] |
|
|
status |
string |
|
|
Acceptable values:
available
pending
sold
| pet status in the store
ApiResponse
{
"code": "integer",
"type": "string",
"message": "string"
}
Fields
Name |
Type |
Format |
Description |
code |
integer |
int32 |
|
type |
string |
|
|
message |
string |
|
|