Skip to content
Get started

Find pet by ID.

GET/pets/{petId}

Find pet by ID.

Path ParametersExpand Collapse
petId: number
formatint64
ReturnsExpand Collapse
Pet = object { name, photoUrls, id, 3 more }
name: string
photoUrls: array of string
id: optional number
formatint64
category: optional Category { id, name }
id: optional number
formatint64
name: optional string
status: optional "available" or "pending" or "sold"

pet status in the store

Accepts one of the following:
"available"
"pending"
"sold"
tags: optional array of Tag { id, name }
id: optional number
formatint64
name: optional string

Find pet by ID.

curl http://localhost:4000/api/v3/pets/$PET_ID \
    -H "Authorization: Bearer $BARKEND_BEARER_TOKEN"
{
  "name": "doggie",
  "photoUrls": [
    "string"
  ],
  "id": 10,
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "status": "available",
  "tags": [
    {
      "id": 0,
      "name": "name"
    }
  ]
}
{
  "error": {
    "id": "invalid_id",
    "message": "Invalid ID supplied"
  }
}
{
  "error": {
    "id": "not_found",
    "message": "Pet not found"
  }
}
Returns Examples
{
  "name": "doggie",
  "photoUrls": [
    "string"
  ],
  "id": 10,
  "category": {
    "id": 1,
    "name": "Dogs"
  },
  "status": "available",
  "tags": [
    {
      "id": 0,
      "name": "name"
    }
  ]
}
{
  "error": {
    "id": "invalid_id",
    "message": "Invalid ID supplied"
  }
}
{
  "error": {
    "id": "not_found",
    "message": "Pet not found"
  }
}