Skip to content

Latest commit

 

History

History
370 lines (279 loc) · 9.17 KB

pet_shop_api.md

File metadata and controls

370 lines (279 loc) · 9.17 KB

Brontosaurus Petstore

This is a sample Petstore server. You can find out more about Brontosaurus at http://spacejam.com. For this sample, you can use the api key special-key to test the authorization filters.

Table of Contents

Methods (16 total)

Data Types (5 total)

Fetch a pet by ID

Parameters: JSON object

  • No extra properties allowed
  • Required fields: id
  • Properties:
    • "id" – required integer

Result type: #pet

Update a pet by ID

Parameters: JSON object

  • No extra properties allowed
  • Required fields: id, pet
  • Properties:
    • "id" – required integer
      • Description: ID of the pet you want to update.
    • "pet" – required JSON object
      • No extra properties allowed
      • Properties:
        • "name" – string
        • "category"#category
        • "photoUrls" – JSON array
          • items: string
            • format: uri
        • "tags" – JSON array
        • "status" – string
          • Must be one of: "available", "pending", "sold"

Result type: #pet

Create a new pet entry

Parameters: JSON object

  • No extra properties allowed
  • Properties:
    • "name" – required string
    • "category" – required #category
    • "photoUrls" – JSON array
      • items: string
        • format: uri
    • "tags" – JSON array
    • "status" – required string
      • Must be one of: "available", "pending", "sold"
  • Required fields: name, category, status

Result type: #pet

Delete a pet entry by ID

Parameters: JSON object

  • No extra properties allowed
  • Required fields: id
  • Properties:
    • "id" – required integer

Required headers:

  • Authorization must have format "^token .+$"

No results

Find a pet that has any of the given statuses.

Parameters: JSON object

  • No extra properties allowed
  • Required fields: any_status
  • Properties:
    • "any_status" – JSON array
      • minLength: 1
      • items: string
        • Must be one of: "available", "pending", "sold"

Result: JSON array

This method is deprecated: This method is no longer supported for some reason or another.

Find a pet that has any of the given tags.

Parameters: JSON object

  • No extra properties allowed
  • Required fields: any_tag
  • Properties:
    • "any_tag" – JSON array
      • minLength: 1
      • items: string
        • title: Tag Name

Result: JSON array

Return a map of statuses to quantities

No parameters

Result: JSON object

  • Required fields: available, pending, sold
  • Properties:
    • "available" – required integer
      • minimum: 0
    • "pending" – required integer
      • minimum: 0
    • "sold" – required integer
      • minimum: 0

Get a purchase order by ID

Parameters: JSON object

  • No extra properties allowed
  • Required fields: id
  • Properties:
    • "id" – required integer

Result type: #order

Delete a purchase order by ID

Parameters: JSON object

  • No extra properties allowed
  • Required fields: id
  • Properties:
    • "id" – required integer

No results

Place an order for a pet.

Parameters: JSON object

  • Required fields: petId, quantity
  • Properties:
    • "petId" – required integer
      • minimum: 0
    • "quantity" – required integer
      • minimum: 1

Result type: #order

Fetch a user by username

Parameters: JSON object

  • Required fields: username
  • No extra properties allowed
  • Properties:
    • "username" – required string
      • minLength: 3

Result type: #user

Update a user

Parameters: JSON object

  • Required fields: username_to_update, user
  • Properties:
    • "username_to_update" – required string
      • Description: Username for the account we'd like to update
    • "user" – required JSON object
      • Description: Properties to set for the user
      • Properties:
        • "username" – string
        • "firstName" – string
        • "lastName" – string
        • "email" – string
          • format: email
        • "password" – string
          • minLength: 7
        • "phone" – string

Result type: #user

Delete a user

Parameters: JSON object

  • No extra properties allowed
  • Required fields: id
  • Properties:
    • "id" – required integer

No results

Logs user into the system

Parameters: JSON object

  • Required fields: username, password
  • No extra properties allowed
  • Properties:
    • "username" – required string
      • minLength: 3
    • "password" – required password
      • minLength: 7

No results

Logs out a currently logged-in user

No parameters

No results

Create a new user account

Parameters: JSON object

  • Description: Properties to set for the user
  • Properties:
    • "username" – string
    • "firstName" – string
    • "lastName" – string
    • "email" – string
      • format: email
    • "password" – string
      • minLength: 7
    • "phone" – string

Result type: #user

Methods using this type: get_pet, find_pet_by_status, update_pet, find_pet_by_tags, create_pet

JSON object

  • No extra properties allowed
  • Required fields: id, category, name, status
  • Properties:
    • "id" – required integer
      • Examples: 0, 1, 2
    • "category" – required #category
    • "name" – required string
      • Examples: "Buster", "Lil Doof"
    • "photoUrls" – JSON array
      • items: string
        • format: uri
      • Examples: ["https://spacejam.com/img/p-jamlogo.gif"]
    • "tags" – JSON array
    • "status" – required string
      • Must be one of: "available", "pending", "sold"

Methods using this type: get_order, create_order

JSON object

  • No extra properties allowed
  • Required fields: id, petId, quantity, shipDate, status, complete
  • Properties:
    • "id" – required integer
    • "petId" – required integer
    • "quantity" – required integer
      • minimum: 1
    • "shipDate" – required string
      • format: date-time
    • "status" – required string
      • Must be one of: "available", "pending", "sold"
    • "complete" – required boolean

Methods using this type: get_user, create_user, update_user

JSON object

  • No extra properties allowed
  • Required fields: id, username, email, password, userStatus
  • Properties:
    • "id" – required integer
    • "username" – required string
    • "firstName" – string
    • "lastName" – string
    • "email" – required string
      • format: email
    • "password" – required string
      • minLength: 7
    • "phone" – string
    • "userStatus" – required integer

Methods using this type: get_pet, create_pet, update_pet

JSON object

  • No extra properties allowed
  • Required fields: id, name
  • Properties:
    • "id" – required integer
    • "name" – required string

Methods using this type: get_pet, create_pet, update_pet

JSON object

  • No extra properties allowed
  • Required fields: id, name
  • Properties:
    • "id" – required integer
    • "name" – required string