Skip to content
Get started

Find pet by ID.

client.Pets.Get(ctx, petID) (*Pet, error)
get/pet/{petId}

Find pet by ID.

ParametersExpand Collapse
petID int64
formatint64
ReturnsExpand Collapse
type Pet struct{…}
Name string
PhotoURLs []string
ID int64optional
formatint64
Category PetCategoryoptional
ID int64optional
formatint64
Name stringoptional
Status PetStatusoptional

pet status in the store

Accepts one of the following:
const PetStatusAvailable PetStatus = "available"
const PetStatusPending PetStatus = "pending"
const PetStatusSold PetStatus = "sold"
Tags []PetTagoptional
ID int64optional
formatint64
Name stringoptional
Find pet by ID.
package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/barkend-go"
  "github.com/stainless-sdks/barkend-go/option"
)

func main() {
  client := barkend.NewClient(
    option.WithAPIKey("My API Key"),
  )
  pet, err := client.Pets.Get(context.TODO(), 0)
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", pet.ID)
}
{
  "error": {
    "id": "invalid_id",
    "message": "Invalid ID supplied"
  }
}
{
  "error": {
    "id": "not_found",
    "message": "Pet not found"
  }
}
Returns Examples
{
  "error": {
    "id": "invalid_id",
    "message": "Invalid ID supplied"
  }
}
{
  "error": {
    "id": "not_found",
    "message": "Pet not found"
  }
}