View Categories

Get a pet by ID

< 1 min read

GET/pets/{petId}

Code Samples #

  • 💻 cURL
  • 📄 JavaScript
  • 🐍 Python
  • 🐘 PHP
  • 🔷 C#
  • Java
Copy
curl --request GET \
  --url 'https://petstore.example.com/v1/pets/{petId}'

Path Parameters #

NameTypeRequiredDescription
petIdinteger (int64)RequiredID of the pet

Responses #

200 — The pet #

FieldTypeRequiredDescription
namestringRequired
tagstringOptional
idinteger (int64)Required
📋
Example 200 response
Copy
{
    "name": "Mochi",
    "tag": "cat",
    "id": 1
}

404 — Pet not found #

Response #

200
{
    "name": "Mochi",
    "tag": "cat",
    "id": 1
}

Powered by BetterDocs

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is registered on wpml.org as a development site. Switch to a production site key to remove this banner.