Skip to content
Go to Micro

Find a record by property value

client.Prism.Objects.Events.Find(ctx, slug, value, params) (*PrismObjectEventFindResponse, error)
GET/v2/prism/{teamId}/event/by/{slug}/{value}

Returns the single record whose property {slug} equals {value}. 404 if nothing matches; 409 if more than one record matches.

ParametersExpand Collapse
slug string
value string
params PrismObjectEventFindParams
TeamID param.Field[string]Optional

Path param

formatuuid
ListID param.Field[string]Optional

Query param: Scope the lookup to a specific list/app.

formatuuid
ReturnsExpand Collapse
type PrismObjectEventFindResponse struct{…}

Object returned by reads (get/create/patch/restore). id is always present.

ID string
formatuuid
Default map[string, unknown]Optional

Properties keyed by property slug.

List unknownOptional

Find a record by property value

package main

import (
  "context"
  "fmt"

  "github.com/micro-so/micro-sdk-go"
  "github.com/micro-so/micro-sdk-go/option"
)

func main() {
  client := micro.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithTeamID("My Team ID"),
  )
  response, err := client.Prism.Objects.Events.Find(
    context.TODO(),
    "slug",
    "value",
    micro.PrismObjectEventFindParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.ID)
}
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "default": {
    "foo": "bar"
  },
  "list": {}
}
Returns Examples
{
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "default": {
    "foo": "bar"
  },
  "list": {}
}