Find pet by ID.
client.pets.retrieve(numberpetID, RequestOptionsoptions?): Pet { name, photoUrls, id, 3 more }
GET/pets/{petId}
Find pet by ID.
Parameters
petID: number
formatint64
Returns
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"
}
}