List saved views for an owner
client.Views.List(ctx, objectType, params) (*ViewListResponse, error)
GET/v2/prism/{teamId}/{objectType}/views
Returns saved view bundles for the path team. Pass ?list_id= to scope to a list (CRM) instead. Cursor pagination matches other Prism list endpoints.
List saved views for an owner
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"),
)
views, err := client.Views.List(
context.TODO(),
micro.ViewListParamsObjectTypeComment,
micro.ViewListParams{
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", views.Data)
}
{
"data": [
{
"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"
}
],
"has_more": true,
"next_cursor": "next_cursor"
}Returns Examples
{
"data": [
{
"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"
}
],
"has_more": true,
"next_cursor": "next_cursor"
}