cap-de-programmatic-filters

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Domo Programmatic Filtering

Domo 程序化筛选

Control what data each viewer sees in embedded Domo content via server-side filters and dataset switching. Enforced by Domo — end users can't bypass. For client-side filtering, see
cap-de-jsapi-filters
.
通过服务器端筛选器和数据集切换,控制每位查看者在嵌入的Domo内容中能看到的数据。该控制由Domo强制执行——终端用户无法绕过。如需客户端筛选,请查看
cap-de-jsapi-filters

How It Works

工作原理

A proxy user (service account) acts on behalf of all viewers. Your server:
  1. Authenticates with Domo (OAuth client credentials → access token)
  2. Requests an embed token with viewer-specific filters
  3. Returns the token to the client, which POSTs it to an iframe
代理用户(服务账户)代表所有查看者执行操作。你的服务器需要:
  1. 与Domo进行身份验证(OAuth客户端凭证 → 访问令牌
  2. 请求带有查看者专属筛选条件的嵌入令牌
  3. 将令牌返回给客户端,客户端通过POST请求将其提交至iframe

Prerequisites

前提条件

  • Domo API client with
    CLIENT_ID
    and
    CLIENT_SECRET
    (developer.domo.com > My Account > New Client)
  • Embed ID (5-char ID from the embed dialog, not the page URL)
  • Dataset column names/IDs for filtering
All auth must happen server-side (CORS restrictions). Never expose credentials client-side.
  • 拥有
    CLIENT_ID
    CLIENT_SECRET
    的Domo API客户端(获取路径:developer.domo.com > 我的账户 > 新建客户端)
  • 嵌入ID(来自嵌入对话框的5字符ID,而非页面URL)
  • 用于筛选的数据集列名/ID
所有身份验证必须在服务器端完成(存在CORS限制)。绝不能在客户端暴露凭证。

The Embed Token Flow

嵌入令牌流程

Step 1: Get an Access Token

步骤1:获取访问令牌

POST https://api.domo.com/oauth/token?grant_type=client_credentials&scope=data%20audit%20user%20dashboard
Authorization: Basic base64(CLIENT_ID:CLIENT_SECRET)
Node.js:
typescript
const credentials = Buffer.from(`${CLIENT_ID}:${CLIENT_SECRET}`).toString('base64')

const response = await fetch(
  'https://api.domo.com/oauth/token?grant_type=client_credentials&scope=data%20audit%20user%20dashboard',
  {
    method: 'GET',
    headers: { Authorization: `Basic ${credentials}` }
  }
)

const { access_token } = await response.json()
Python:
python
import requests
from base64 import b64encode

credentials = b64encode(f"{CLIENT_ID}:{CLIENT_SECRET}".encode()).decode()

response = requests.get(
    "https://api.domo.com/oauth/token",
    params={"grant_type": "client_credentials", "scope": "data audit user dashboard"},
    headers={"Authorization": f"Basic {credentials}"}
)

access_token = response.json()["access_token"]
POST https://api.domo.com/oauth/token?grant_type=client_credentials&scope=data%20audit%20user%20dashboard
Authorization: Basic base64(CLIENT_ID:CLIENT_SECRET)
Node.js:
typescript
const credentials = Buffer.from(`${CLIENT_ID}:${CLIENT_SECRET}`).toString('base64')

const response = await fetch(
  'https://api.domo.com/oauth/token?grant_type=client_credentials&scope=data%20audit%20user%20dashboard',
  {
    method: 'GET',
    headers: { Authorization: `Basic ${credentials}` }
  }
)

const { access_token } = await response.json()
Python:
python
import requests
from base64 import b64encode

credentials = b64encode(f"{CLIENT_ID}:{CLIENT_SECRET}".encode()).decode()

response = requests.get(
    "https://api.domo.com/oauth/token",
    params={"grant_type": "client_credentials", "scope": "data audit user dashboard"},
    headers={"Authorization": f"Basic {credentials}"}
)

access_token = response.json()["access_token"]

Step 2: Request an Embed Token with Filters

步骤2:请求带筛选条件的嵌入令牌

Use the access token to request an embed token, including your filters in the
authorizations
payload:
For dashboards:
POST https://api.domo.com/v1/stories/embed/auth
Authorization: Bearer {access_token}
Content-Type: application/json
For cards:
POST https://api.domo.com/v1/cards/embed/auth
Authorization: Bearer {access_token}
Content-Type: application/json
Payload structure:
json
{
  "sessionLength": 1440,
  "authorizations": [
    {
      "token": "<embed_id>",
      "permissions": ["READ", "FILTER", "EXPORT"],
      "filters": [],
      "policies": []
    }
  ]
}
  • sessionLength
    : Token validity in minutes (1440 = 24 hours)
  • token
    : The embed ID for the dashboard or card
  • permissions
    : Array of granted permissions —
    READ
    ,
    FILTER
    ,
    EXPORT
  • filters
    : Array of standard filter objects (see below)
  • policies
    : Array of PDP policy IDs to apply (optional)
The response includes an
authentication
property containing the embed token.
使用访问令牌请求嵌入令牌,在
authorizations
负载中包含你的筛选条件:
针对仪表盘:
POST https://api.domo.com/v1/stories/embed/auth
Authorization: Bearer {access_token}
Content-Type: application/json
针对卡片:
POST https://api.domo.com/v1/cards/embed/auth
Authorization: Bearer {access_token}
Content-Type: application/json
负载结构:
json
{
  "sessionLength": 1440,
  "authorizations": [
    {
      "token": "<embed_id>",
      "permissions": ["READ", "FILTER", "EXPORT"],
      "filters": [],
      "policies": []
    }
  ]
}
  • sessionLength
    :令牌有效期(分钟),1440代表24小时
  • token
    :仪表盘或卡片的嵌入ID
  • permissions
    :授予的权限数组,可选值
    READ
    FILTER
    EXPORT
  • filters
    :标准筛选器对象数组(详见下文)
  • policies
    :要应用的PDP策略ID数组(可选)
响应中包含
authentication
字段,其值即为嵌入令牌。

Step 3: Render the Embed

步骤3:渲染嵌入内容

Submit via hidden POST form targeting an iframe. Dashboard:
https://public.domo.com/embed/pages/{embed_id}
, Card:
https://public.domo.com/cards/{embed_id}
html
<iframe id="domo-embed" name="domo-embed" width="100%" height="600"></iframe>

<form id="embed-form" action="https://public.domo.com/embed/pages/{embed_id}" method="POST" target="domo-embed">
  <input type="hidden" name="embedToken" value="{embed_token}" />
</form>

<script>document.getElementById('embed-form').submit();</script>
POST submission prevents the token from appearing in URLs or browser history.

通过隐藏的POST表单提交至iframe。仪表盘地址:
https://public.domo.com/embed/pages/{embed_id}
,卡片地址:
https://public.domo.com/cards/{embed_id}
html
<iframe id="domo-embed" name="domo-embed" width="100%" height="600"></iframe>

<form id="embed-form" action="https://public.domo.com/embed/pages/{embed_id}" method="POST" target="domo-embed">
  <input type="hidden" name="embedToken" value="{embed_token}" />
</form>

<script>document.getElementById('embed-form').submit();</script>
使用POST提交可避免令牌出现在URL或浏览器历史记录中。

Filter Types

筛选器类型

Two types: standard filters and SQL filters, both in the embed token request.
分为两种类型:标准筛选器SQL筛选器,均需在嵌入令牌请求中配置。

Standard Filters

标准筛选器

json
{
  "column": "Region",
  "operator": "IN",
  "values": ["West", "East"]
}
Required properties:
PropertyTypeDescription
column
stringThe exact column name in the dataset
operator
stringThe comparison operator (see table below)
values
arrayValues to filter against
Optional properties:
PropertyTypeDescription
datasourceId
string (UUID)Restrict filter to a specific dataset. Without this, the filter applies to all datasets in the embed that have a matching column name.
json
{
  "column": "Region",
  "operator": "IN",
  "values": ["West", "East"]
}
必填属性:
属性类型描述
column
字符串数据集中的精确列名
operator
字符串比较运算符(见下表)
values
数组用于筛选的值列表
可选属性:
属性类型描述
datasourceId
字符串(UUID)将筛选器限制到特定数据集。若不设置,筛选器会应用到嵌入内容中所有包含匹配列名的数据集。

Operators

运算符列表

OperatorDescriptionTypical Use
IN
Column value is in the listMulti-value match
NOT_IN
Column value is not in the listExclusion
EQUALS
Column value equalsSingle-value exact match
NOT_EQUALS
Column value does not equalSingle-value exclusion
GREATER_THAN
Column value is greater thanNumeric/date range
GREATER_THAN_EQUALS_TO
Column value is greater than or equalNumeric/date range
LESS_THAN
Column value is less thanNumeric/date range
LESS_THAN_EQUALS_TO
Column value is less than or equalNumeric/date range
运算符描述典型用途
IN
列值在列表中多值匹配
NOT_IN
列值不在列表中排除特定值
EQUALS
列值完全匹配单值精确匹配
NOT_EQUALS
列值不匹配排除单个值
GREATER_THAN
列值大于指定值数值/日期范围筛选
GREATER_THAN_EQUALS_TO
列值大于等于指定值数值/日期范围筛选
LESS_THAN
列值小于指定值数值/日期范围筛选
LESS_THAN_EQUALS_TO
列值小于等于指定值数值/日期范围筛选

Standard Filter Examples

标准筛选器示例

Single filter — show only West region:
json
{
  "filters": [
    {
      "column": "Region",
      "operator": "IN",
      "values": ["West"]
    }
  ]
}
Multiple filters — West region, revenue over 10000:
json
{
  "filters": [
    {
      "column": "Region",
      "operator": "IN",
      "values": ["West"]
    },
    {
      "column": "Revenue",
      "operator": "GREATER_THAN",
      "values": [10000]
    }
  ]
}
Dataset-specific filter — only apply to one dataset in a multi-dataset dashboard:
json
{
  "filters": [
    {
      "column": "Region",
      "operator": "IN",
      "values": ["West"],
      "datasourceId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
  ]
}
单一筛选器——仅显示西部区域:
json
{
  "filters": [
    {
      "column": "Region",
      "operator": "IN",
      "values": ["West"]
    }
  ]
}
多筛选器——西部区域且收入超过10000:
json
{
  "filters": [
    {
      "column": "Region",
      "operator": "IN",
      "values": ["West"]
    },
    {
      "column": "Revenue",
      "operator": "GREATER_THAN",
      "values": [10000]
    }
  ]
}
数据集专属筛选器——仅应用到多数据集仪表盘中的某一个数据集:
json
{
  "filters": [
    {
      "column": "Region",
      "operator": "IN",
      "values": ["West"],
      "datasourceId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
  ]
}

SQL Filters

SQL筛选器

For complex logic (OR, BETWEEN, LIKE, nested expressions), use SQL WHERE syntax via
sqlFilters
(sibling to
filters
, not nested).
json
{
  "authorizations": [
    {
      "token": "<embed_id>",
      "permissions": ["READ", "FILTER", "EXPORT"],
      "filters": [],
      "sqlFilters": [
        {
          "sqlFilter": "`Region` IN ('West', 'East') AND `Revenue` > 10000",
          "datasourceIds": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
        }
      ]
    }
  ]
}
Required properties:
PropertyTypeDescription
sqlFilter
stringSQL WHERE clause syntax
Optional properties:
PropertyTypeDescription
datasourceIds
string[]Array of dataset UUIDs to apply the filter to
对于复杂逻辑(如OR、BETWEEN、LIKE、嵌套表达式),可通过
sqlFilters
使用SQL WHERE语法(
sqlFilters
filters
同级,而非嵌套)。
json
{
  "authorizations": [
    {
      "token": "<embed_id>",
      "permissions": ["READ", "FILTER", "EXPORT"],
      "filters": [],
      "sqlFilters": [
        {
          "sqlFilter": "`Region` IN ('West', 'East') AND `Revenue` > 10000",
          "datasourceIds": ["xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"]
        }
      ]
    }
  ]
}
必填属性:
属性类型描述
sqlFilter
字符串SQL WHERE子句语法
可选属性:
属性类型描述
datasourceIds
字符串数组应用该筛选器的数据集UUID数组

Syntax Rules

语法规则

Column names in backticks, strings in single quotes, numerics unquoted. Supports:
IN
,
NOT IN
,
BETWEEN
,
LIKE
,
AND
,
OR
,
IS NULL
,
IS NOT NULL
. Use parentheses for grouping.
列名使用反引号,字符串使用单引号,数值无需引号。支持
IN
NOT IN
BETWEEN
LIKE
AND
OR
IS NULL
IS NOT NULL
,可使用括号进行分组。

SQL Filter Examples

SQL筛选器示例

OR condition (not possible with standard filters alone):
json
{
  "sqlFilter": "`Region` = 'West' OR `Department` = 'Sales'"
}
BETWEEN for date ranges:
json
{
  "sqlFilter": "`Order Date` BETWEEN '2024-01-01' AND '2024-12-31'"
}
LIKE for partial matching:
json
{
  "sqlFilter": "`Product Name` LIKE '%Pro%'"
}
Complex nested logic:
json
{
  "sqlFilter": "(`Region` IN ('West', 'East') AND `Revenue` > 10000) OR `Priority` = 'Critical'"
}
Targeting specific datasets:
json
{
  "sqlFilter": "`Status` = 'Active'",
  "datasourceIds": [
    "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"
  ]
}
OR条件(标准筛选器无法单独实现):
json
{
  "sqlFilter": "`Region` = 'West' OR `Department` = 'Sales'"
}
BETWEEN日期范围:
json
{
  "sqlFilter": "`Order Date` BETWEEN '2024-01-01' AND '2024-12-31'"
}
LIKE模糊匹配:
json
{
  "sqlFilter": "`Product Name` LIKE '%Pro%'"
}
复杂嵌套逻辑:
json
{
  "sqlFilter": "(`Region` IN ('West', 'East') AND `Revenue` > 10000) OR `Priority` = 'Critical'"
}
针对特定数据集:
json
{
  "sqlFilter": "`Status` = 'Active'",
  "datasourceIds": [
    "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"
  ]
}

Combining Standard and SQL Filters

组合标准筛选器与SQL筛选器

Both can coexist in one authorization. Standard filters apply first, then SQL filters narrow further:
json
{
  "token": "<embed_id>",
  "permissions": ["READ", "FILTER", "EXPORT"],
  "filters": [
    {
      "column": "Region",
      "operator": "IN",
      "values": ["West"]
    }
  ],
  "sqlFilters": [
    {
      "sqlFilter": "`Revenue` > 10000 OR `Priority` = 'Critical'"
    }
  ]
}

两者可在同一个授权中共存。标准筛选器先生效,SQL筛选器再进一步缩小范围:
json
{
  "token": "<embed_id>",
  "permissions": ["READ", "FILTER", "EXPORT"],
  "filters": [
    {
      "column": "Region",
      "operator": "IN",
      "values": ["West"]
    }
  ],
  "sqlFilters": [
    {
      "sqlFilter": "`Revenue` > 10000 OR `Priority` = 'Critical'"
    }
  ]
}

Common Patterns

常见模式

Per-User Filtering

按用户筛选

Store user-to-filter mappings in your database, look up at embed time:
typescript
// Pseudocode — adapt to your framework and data layer
async function getEmbedTokenForUser(userId: string, embedId: string) {
  const user = await getUser(userId)
  const dashboard = user.dashboards.find(d => d.embedId === embedId)

  const filters = dashboard.filters.map(f => ({
    column: f.column,
    operator: f.operator,
    values: f.values
  }))

  const accessToken = await getDomoAccessToken()
  const embedToken = await getDomoEmbedToken(accessToken, embedId, filters)

  return embedToken
}
在数据库中存储用户与筛选条件的映射关系,嵌入时查询获取:
typescript
// 伪代码——根据你的框架和数据层调整
async function getEmbedTokenForUser(userId: string, embedId: string) {
  const user = await getUser(userId)
  const dashboard = user.dashboards.find(d => d.embedId === embedId)

  const filters = dashboard.filters.map(f => ({
    column: f.column,
    operator: f.operator,
    values: f.values
  }))

  const accessToken = await getDomoAccessToken()
  const embedToken = await getDomoEmbedToken(accessToken, embedId, filters)

  return embedToken
}

Role-Based Filtering

按角色筛选

Apply different filters based on user role rather than individual assignments:
typescript
function getFiltersForRole(role: string): Filter[] {
  switch (role) {
    case 'regional-manager':
      return [{ column: 'Region', operator: 'IN', values: [user.region] }]
    case 'executive':
      return [] // No filters — sees everything
    case 'analyst':
      return [{ column: 'Department', operator: 'EQUALS', values: [user.department] }]
    default:
      return [{ column: 'Public', operator: 'EQUALS', values: ['true'] }]
  }
}

根据用户角色应用不同的筛选条件,而非单独配置每个用户:
typescript
function getFiltersForRole(role: string): Filter[] {
  switch (role) {
    case 'regional-manager':
      return [{ column: 'Region', operator: 'IN', values: [user.region] }]
    case 'executive':
      return [] // 无筛选条件——查看全部数据
    case 'analyst':
      return [{ column: 'Department', operator: 'EQUALS', values: [user.department] }]
    default:
      return [{ column: 'Public', operator: 'EQUALS', values: ['true'] }]
  }
}

Dataset Switching

数据集切换

Redirect the underlying dataset of an embedded dashboard at embed time — useful for multi-tenant architectures where each customer has their own dataset with the same schema.
在嵌入时重定向嵌入仪表盘的底层数据集——适用于多租户架构,每个客户拥有独立但 schema 相同的数据集。

How It Works

工作原理

Pass
datasetRedirects
in the authorization object (original dataset ID → target dataset ID):
json
{
  "sessionLength": 1440,
  "authorizations": [
    {
      "token": "<embed_id>",
      "permissions": ["READ", "FILTER", "EXPORT"],
      "filters": [],
      "datasetRedirects": {
        "original-dataset-uuid-1": "target-dataset-uuid-1",
        "original-dataset-uuid-2": "target-dataset-uuid-2"
      }
    }
  ]
}
Target datasets must match the original schema (column names and types).
在授权对象中传递
datasetRedirects
(原始数据集ID → 目标数据集ID):
json
{
  "sessionLength": 1440,
  "authorizations": [
    {
      "token": "<embed_id>",
      "permissions": ["READ", "FILTER", "EXPORT"],
      "filters": [],
      "datasetRedirects": {
        "original-dataset-uuid-1": "target-dataset-uuid-1",
        "original-dataset-uuid-2": "target-dataset-uuid-2"
      }
    }
  ]
}
目标数据集必须与原始数据集的schema匹配(列名和类型一致)。

Combining with Filters

与筛选器结合使用

Redirects apply first, then filters run against the swapped dataset:
json
{
  "sessionLength": 1440,
  "authorizations": [
    {
      "token": "<embed_id>",
      "permissions": ["READ", "FILTER", "EXPORT"],
      "datasetRedirects": {
        "a19d0ef1-ca31-4bfd-b168-018b93109671": "a19d0ef1-ca31-4bfd-b168-018b93109672"
      },
      "filters": [
        { "column": "Color", "operator": "IN", "values": ["Red"] },
        { "column": "Model", "operator": "IN", "values": ["Mountain", "Road", "Commuter"] }
      ]
    }
  ]
}
重定向先生效,然后筛选器在切换后的数据集上运行:
json
{
  "sessionLength": 1440,
  "authorizations": [
    {
      "token": "<embed_id>",
      "permissions": ["READ", "FILTER", "EXPORT"],
      "datasetRedirects": {
        "a19d0ef1-ca31-4bfd-b168-018b93109671": "a19d0ef1-ca31-4bfd-b168-018b93109672"
      },
      "filters": [
        { "column": "Color", "operator": "IN", "values": ["Red"] },
        { "column": "Model", "operator": "IN", "values": ["Mountain", "Road", "Commuter"] }
      ]
    }
  ]
}

Per-User Dataset Switching

按用户切换数据集

Map each tenant to their dataset IDs:
typescript
function getDatasetRedirects(tenant: Tenant): Record<string, string> {
  // The template dashboard was built on these "original" datasets
  const templateDatasets = {
    sales: 'aaaa-bbbb-cccc-dddd',
    inventory: 'eeee-ffff-gggg-hhhh'
  }

  // Each tenant has their own copies
  return {
    [templateDatasets.sales]: tenant.salesDatasetId,
    [templateDatasets.inventory]: tenant.inventoryDatasetId
  }
}
将每个租户映射到其对应的数据集ID:
typescript
function getDatasetRedirects(tenant: Tenant): Record<string, string> {
  // 模板仪表盘基于这些「原始」数据集构建
  const templateDatasets = {
    sales: 'aaaa-bbbb-cccc-dddd',
    inventory: 'eeee-ffff-gggg-hhhh'
  }

  // 每个租户拥有独立的副本
  return {
    [templateDatasets.sales]: tenant.salesDatasetId,
    [templateDatasets.inventory]: tenant.inventoryDatasetId
  }
}

Important Notes

重要注意事项

  • Schema must match — column names and types must be identical (cards, filters, and calculated fields reference by name)
  • Partial redirects OK — redirect all, some, or none of a dashboard's datasets
  • Compatible with all filter types — redirects apply first, then standard/SQL/PDP filters

  • Schema必须匹配——列名和类型必须完全一致(卡片、筛选器和计算字段均按名称引用)
  • 支持部分重定向——可重定向仪表盘的全部、部分或无数据集
  • 兼容所有筛选器类型——重定向先生效,然后应用标准/SQL/PDP筛选器

Gotchas and Best Practices

注意事项与最佳实践

  • JWT size limit (~8KB): Long value lists hit this. Solutions: aggregate columns in Domo, use SQL filters, or split with
    datasourceId
    targeting.
  • Column name matching: Exact spelling and case required. Without
    datasourceId
    , filters apply to all datasets with a matching column.
  • Token refresh: Cache access tokens, refresh before expiry. Generate embed tokens per-request.
  • Empty filters:
    []
    means no filtering (user sees everything). Always include the
    filters
    key — don't omit it.
  • Filter validation:
    values
    must be an array (even for
    EQUALS
    ). Numerics must be numbers, not strings. Operator names are exact (
    GREATER_THAN_EQUALS_TO
    , not
    GREATER_THAN_OR_EQUAL
    ).
  • Security: Never generate tokens client-side. Validate embed ID authorization and filter values server-side. Use minimum
    permissions
    (omit
    EXPORT
    if not needed).

  • JWT大小限制(约8KB):过长的值列表会触发该限制。解决方案:在Domo中聚合列、使用SQL筛选器,或通过
    datasourceId
    定向拆分筛选。
  • 列名匹配:必须完全匹配拼写和大小写。若未设置
    datasourceId
    ,筛选器会应用到所有包含匹配列名的数据集。
  • 令牌刷新:缓存访问令牌,在过期前刷新。嵌入令牌需按需生成。
  • 空筛选器
    []
    表示无筛选条件(用户可查看全部数据)。务必包含
    filters
    键——不要省略。
  • 筛选器验证
    values
    必须是数组(即使是
    EQUALS
    运算符)。数值必须是数字类型,而非字符串。运算符名称需完全匹配(如
    GREATER_THAN_EQUALS_TO
    ,不能简写为
    GREATER_THAN_OR_EQUAL
    )。
  • 安全性:绝不在客户端生成令牌。在服务器端验证嵌入ID的授权和筛选值。使用最小权限(若无需导出则省略
    EXPORT
    )。

TypeScript Type Definitions

TypeScript类型定义

typescript
type FilterOperator =
  | 'IN'
  | 'NOT_IN'
  | 'EQUALS'
  | 'NOT_EQUALS'
  | 'GREATER_THAN'
  | 'GREATER_THAN_EQUALS_TO'
  | 'LESS_THAN'
  | 'LESS_THAN_EQUALS_TO'

interface StandardFilter {
  column: string
  operator: FilterOperator
  values: (string | number)[]
  datasourceId?: string
}

interface SqlFilter {
  sqlFilter: string
  datasourceIds?: string[]
}

type EmbedPermission = 'READ' | 'FILTER' | 'EXPORT'

interface EmbedAuthorization {
  token: string
  permissions: EmbedPermission[]
  filters: StandardFilter[]
  sqlFilters?: SqlFilter[]
  policies?: string[]
  datasetRedirects?: Record<string, string>  // originalDatasetId → targetDatasetId
}

interface EmbedTokenRequest {
  sessionLength: number
  authorizations: EmbedAuthorization[]
}

typescript
type FilterOperator =
  | 'IN'
  | 'NOT_IN'
  | 'EQUALS'
  | 'NOT_EQUALS'
  | 'GREATER_THAN'
  | 'GREATER_THAN_EQUALS_TO'
  | 'LESS_THAN'
  | 'LESS_THAN_EQUALS_TO'

interface StandardFilter {
  column: string
  operator: FilterOperator
  values: (string | number)[]
  datasourceId?: string
}

interface SqlFilter {
  sqlFilter: string
  datasourceIds?: string[]
}

type EmbedPermission = 'READ' | 'FILTER' | 'EXPORT'

interface EmbedAuthorization {
  token: string
  permissions: EmbedPermission[]
  filters: StandardFilter[]
  sqlFilters?: SqlFilter[]
  policies?: string[]
  datasetRedirects?: Record<string, string>  // originalDatasetId → targetDatasetId
}

interface EmbedTokenRequest {
  sessionLength: number
  authorizations: EmbedAuthorization[]
}

Quick Reference

快速参考

Read
references/api-endpoints.md
for the complete list of Domo API endpoints used in programmatic filtering.
请查看
references/api-endpoints.md
获取程序化筛选中使用的完整Domo API端点列表。