Skip to content
Get started

Find pet by ID.

client.pets.retrieve(numberpetID, RequestOptionsoptions?): Pet { name, photoUrls, id, 3 more }
GET/pets/{petId}

Find pet by ID.

ParametersExpand Collapse
petID: number
formatint64
ReturnsExpand Collapse
Pet { name, photoUrls, id, 3 more }
name: string
photoUrls: Array<string>
id?: number
formatint64
category?: Category { id, name }
id?: number
formatint64
name?: string
status?: "available" | "pending" | "sold"

pet status in the store

Accepts one of the following:
"available"
"pending"
"sold"
tags?: Array<Tag { id, name } >
id?: number
formatint64
name?: string

Find pet by ID.

import Barkend from 'barkend';

const client = new Barkend({
  bearerToken: process.env['BARKEND_BEARER_TOKEN'], // This is the default and can be omitted
});

const pet = await client.pets.retrieve(0);

console.log(pet.id);
{
  "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"
  }
}