Add a new pet to the store.
Parameters
Returns
Add a new pet to the store.
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.New(context.TODO(), barkend.PetNewParams{
Pet: barkend.PetParam{
Name: "doggie",
PhotoURLs: []string{"string"},
},
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", pet.ID)
}
{
"id": 10,
"name": "doggie",
"photoUrls": [
"https://example.com/dog.jpg"
],
"category": {
"id": 1,
"name": "Dogs"
},
"tags": [
{
"id": 1,
"name": "friendly"
}
],
"status": "available"
}
{
"error": {
"id": "invalid_input",
"message": "Invalid input - name and photoUrls required"
}
}
Returns Examples
{
"id": 10,
"name": "doggie",
"photoUrls": [
"https://example.com/dog.jpg"
],
"category": {
"id": 1,
"name": "Dogs"
},
"tags": [
{
"id": 1,
"name": "friendly"
}
],
"status": "available"
}
{
"error": {
"id": "invalid_input",
"message": "Invalid input - name and photoUrls required"
}
}