View Categories

Find pet by ID.

< 1 min read

GET/pet/{petId}

Code Samples #

  • 💻 cURL
  • 📄 JavaScript
  • 🐍 Python
  • 🐘 PHP
  • 🔷 C#
  • Java
Copy
curl --request GET \
  --url '/api/v3/pet/{petId}' \
  --header 'api_key: YOUR_API_KEY'

Returns A single pet.

Path Parameters #

NameTypeRequiredDescription
petIdinteger (int64)RequiredID of pet to return

Responses #

200 — successful operation #

FieldTypeRequiredDescription
idinteger (int64)Optional
namestringRequired
categoryobjectOptional
category.idinteger (int64)Optional
category.namestringOptional
photoUrlsarray of stringRequired
tagsarray of objectOptional
statusstringOptionalpet status in the store Allowed: available, pending, sold
📋
Example 200 response
Copy
{
    "id": 10,
    "name": "doggie",
    "category": {
        "id": 1,
        "name": "Dogs"
    },
    "photoUrls": [
        "string"
    ],
    "tags": [
        {
            "id": 1,
            "name": "string"
        }
    ],
    "status": "available"
}

400 — Invalid ID supplied #

404 — Pet not found #

default — Unexpected error #

Response #

200
{
    "id": 10,
    "name": "doggie",
    "category": {
        "id": 1,
        "name": "Dogs"
    },
    "photoUrls": [
        "string"
    ],
    "tags": [
        {
            "id": 1,
            "name": "string"
        }
    ],
    "status": "available"
}

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.