Skip to content
Go to Micro

Read a view bundle

client.Views.Get(ctx, viewObjectType, viewID, params) (*ViewGetResponse, error)
GET/v2/prism/{teamId}/{viewObjectType}/views/{viewId}

Returns the view bundle. Pass ?include=records to also fetch a page of records selected by the view in the same call; the response is then wrapped as {view, records}.

ParametersExpand Collapse
One of the following:
const ViewGetParamsViewObjectTypeAction ViewGetParamsViewObjectType = "action"
const ViewGetParamsViewObjectTypeDeal ViewGetParamsViewObjectType = "deal"
const ViewGetParamsViewObjectTypeDocument ViewGetParamsViewObjectType = "document"
const ViewGetParamsViewObjectTypeEvent ViewGetParamsViewObjectType = "event"
const ViewGetParamsViewObjectTypeIdentity ViewGetParamsViewObjectType = "identity"
const ViewGetParamsViewObjectTypeOrganization ViewGetParamsViewObjectType = "organization"
viewID string
formatuuid
params ViewGetParams
TeamID param.Field[string]Optional

Path param

formatuuid
Cursor param.Field[string]Optional

Query param: Forwarded to the records sub-resource when include=records.

Include param.Field[string]Optional

Query param: Comma-separated list of optional sub-resources to inline. Currently the only recognized value is records — when present, the response is {view, records} rather than the bare view bundle.

Limit param.Field[int64]Optional

Query param: Forwarded to the records sub-resource when include=records.

minimum0
maximum50
Page param.Field[int64]Optional

Query param: Forwarded to the records sub-resource when include=records.

minimum1
ReturnsExpand Collapse
type ViewGetResponse interface{…}

A view (saved configuration for displaying records of a given object type) plus its select/filter/sort children. Properties in select/filter/sort are referenced by slug.

One of the following:
type ViewGetResponseViewBundle struct{…}

A view (saved configuration for displaying records of a given object type) plus its select/filter/sort children. Properties in select/filter/sort are referenced by slug.

Name string
ViewType string
ID stringOptional
formatuuid
AggregationPropDefID stringOptional
formatuuid
AggregationType stringOptional
ColumnLayout map[string, unknown]Optional
Combinator ViewGetResponseViewBundleCombinatorOptional
One of the following:
const ViewGetResponseViewBundleCombinatorAnd ViewGetResponseViewBundleCombinator = "AND"
const ViewGetResponseViewBundleCombinatorOr ViewGetResponseViewBundleCombinator = "OR"
CreatedAt stringOptional
Filter []map[string, unknown]Optional

Each entry is { slug: { comparator: value } }

GroupBy stringOptional

Property slug to group by

GroupHiddenOptionIDs []unknownOptional
One of the following:
[]unknown
GroupHideEmpty boolOptional
GroupSort stringOptional
Icon stringOptional
ListID stringOptional
formatuuid
Select []stringOptional

Property slugs (dot-paths permitted for refs)

Sort []map[string, unknown]Optional

Each entry is { slug: ‘asc’ | ‘desc’ }

SortOrder int64Optional
TeamID stringOptional
formatuuid
UpdatedAt stringOptional
UserID stringOptional
type ViewGetResponseViewBundleWithRecords struct{…}

Returned by GET /views/{viewId}?include=records. Same records shape as the standalone list-view-records endpoint.

Records ViewGetResponseViewBundleWithRecordsRecords
Data []map[string, unknown]
HasMore bool
NextCursor stringOptional
View ViewGetResponseViewBundleWithRecordsView

A view (saved configuration for displaying records of a given object type) plus its select/filter/sort children. Properties in select/filter/sort are referenced by slug.

Name string
ViewType string
ID stringOptional
formatuuid
AggregationPropDefID stringOptional
formatuuid
AggregationType stringOptional
ColumnLayout map[string, unknown]Optional
Combinator ViewGetResponseViewBundleWithRecordsViewCombinatorOptional
One of the following:
const ViewGetResponseViewBundleWithRecordsViewCombinatorAnd ViewGetResponseViewBundleWithRecordsViewCombinator = "AND"
const ViewGetResponseViewBundleWithRecordsViewCombinatorOr ViewGetResponseViewBundleWithRecordsViewCombinator = "OR"
CreatedAt stringOptional
Filter []map[string, unknown]Optional

Each entry is { slug: { comparator: value } }

GroupBy stringOptional

Property slug to group by

GroupHiddenOptionIDs []unknownOptional
One of the following:
[]unknown
GroupHideEmpty boolOptional
GroupSort stringOptional
Icon stringOptional
ListID stringOptional
formatuuid
Select []stringOptional

Property slugs (dot-paths permitted for refs)

Sort []map[string, unknown]Optional

Each entry is { slug: ‘asc’ | ‘desc’ }

SortOrder int64Optional
TeamID stringOptional
formatuuid
UpdatedAt stringOptional
UserID stringOptional

Read a view bundle

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"),
  )
  view, err := client.Views.Get(
    context.TODO(),
    micro.ViewGetParamsViewObjectTypeAction,
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    micro.ViewGetParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", view)
}
{
  "name": "name",
  "view_type": "view_type",
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "aggregation_prop_def_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "aggregation_type": "aggregation_type",
  "column_layout": {
    "foo": "bar"
  },
  "combinator": "AND",
  "created_at": "created_at",
  "filter": [
    {
      "foo": "bar"
    }
  ],
  "group_by": "group_by",
  "group_hidden_option_ids": [
    {}
  ],
  "group_hide_empty": true,
  "group_sort": "group_sort",
  "icon": "icon",
  "list_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "select": [
    "string"
  ],
  "sort": [
    {
      "foo": "bar"
    }
  ],
  "sort_order": 0,
  "team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "updated_at": "updated_at",
  "user_id": "user_id"
}
Returns Examples
{
  "name": "name",
  "view_type": "view_type",
  "id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "aggregation_prop_def_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "aggregation_type": "aggregation_type",
  "column_layout": {
    "foo": "bar"
  },
  "combinator": "AND",
  "created_at": "created_at",
  "filter": [
    {
      "foo": "bar"
    }
  ],
  "group_by": "group_by",
  "group_hidden_option_ids": [
    {}
  ],
  "group_hide_empty": true,
  "group_sort": "group_sort",
  "icon": "icon",
  "list_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "select": [
    "string"
  ],
  "sort": [
    {
      "foo": "bar"
    }
  ],
  "sort_order": 0,
  "team_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
  "updated_at": "updated_at",
  "user_id": "user_id"
}