OpenAPI YAMLOpenAPI JSON问题 YAMLAPI 概览
此分组有 14 个操作,由 api/openapi.yaml 生成。可按路径、操作或认证筛选。每个端点都会列出其输入;展开后可查看请求模板和响应代码。模板需要您自己的值和符合架构的请求体。
用你的值替换大写占位符。对于JSON请求,请保存符合request.json模式的请求体。Cookie示例使用经过身份验证会话的本地Cookie存储。
BI 仪表板:Power BI、Tableau 和需要登录的网页的连接与视图
列出 BI 连接
按从旧到新的顺序列出项目的 BI 连接,每页 200 个;把 next_cursor 作为 cursor 传回即可获取下一页。密钥绝不会返回:secret 仅显示是否已设置及其最后 4 个字符。
参数
| 名称 | 发送 | 必需? | 描述 |
|---|---|---|---|
| ScreenRig-Project | header | 可选 | 已弃用一个版本。必须与 JWT 项目授权保持一致;添加弃用和警告头。无令牌交换。 |
| 游标 | 查询 | 可选 | 上一页的 next_cursor。 |
| 限制 | 查询 | 可选 |
请求模板和响应
curl --request GET --header 'Authorization: Bearer [SCREENRIG_TOKEN]' --cookie cookies.txt --cookie-jar cookies.txt 'https://screenrig.ai/api/bi-connections'响应
| 状态 | 含义 | 正文和头部 |
|---|---|---|
| 200 | 一页连接。 | BIConnectionList(application/json);头信息:Cache-Control |
| 400 | invalid_request,包括格式错误的游标。 | 问题 (application/problem+json) |
| 默认 | 稳定的 RFC 9457 问题响应。421 server_draining 携带 1 秒的 Retry-After,500 not_ready 或 dependency_unavailable 携带 5 秒,500 manifest_degraded 携带 60 秒,除非处理程序设置了更具体的值。 | 问题 (application/problem+json) |
创建 BI 连接
为项目拥有的 BI 系统添加一个连接。对于 Grafana:其地址(公共主机上的 http 或 https,可带路径前缀)以及具有 Viewer 角色的服务账户令牌。令牌会被加密封存,绝不会返回。
Grafana renders dashboards for screens through its Image Renderer plugin or remote rendering service, so the customer installs one; run POST /api/bi-connections/{id}/test to check. For Power BI (kind powerbi): config.tenant_id and config.client_id of a Microsoft Entra app registration and its client secret value as secret.
Power BI 管理员必须为该应用启用开发者设置 Embed content in apps 和 Service principals can call Fabric public APIs(管理门户,租户设置);该应用必须是其所显示的每个工作区的成员或管理员;生产环境中的报表需要 Embedded、Fabric 或 Premium 容量。
For Tableau (kind tableau): config.url (the https address of Tableau Server, or of your Tableau Cloud pod such as https://10ay.online.tableau.com), config.site (the site content URL, empty for the default site), config.client_id and config.secret_id of a connected app with direct trust, config.username (the Tableau user the screens views are shown as) and the secret value as secret.
把响应中的 embed_origin 加入已连接应用的域名允许列表,并启用密钥。持有屏幕票据的人可以嵌入该用户能看到的任何视图,因此请使用只能看到屏幕仪表板的用户。Tableau Cloud,或 Tableau Server 2023.3 及更高版本。
适用于需要登录的网页(kind web):显示登录后仪表板的网站的服务账号。config.login_mode 为 auto(config.login_url、config.username 和作为 secret 的密码:渲染器打开登录页面并填写表单)、steps(config.login_url 和 config.steps,由 goto、fill、click、press、wait_for 和 wait_ms 步骤组成的脚本,其值可包含 {{username}}、{{password}} 和 {{otp}})或 none(不登录:连接用您提供的 Cookie 显示页面)。totp_secret 是账号身份验证器应用的 base32 密钥或 otpauth:// 地址:服务器计算一次性验证码(RFC 6238),只向渲染器发送验证码。cookies 是从已登录浏览器导出的 Cookie 集,适用于登录无法用脚本完成的网站(在手机上批准的单点登录、设备检查);服务器保留该 Cookie 集,并用每次截图返回的 Cookie 续期,因此很少需要登录。
密码、种子和 Cookie 都加密封存,绝不会返回。请使用只读的服务账号。密码只会在 config.login_url 和 goto 步骤中输入,因此把它们换到另一个来源需要重新提供 secret。连续五次登录被拒绝后,连接会停止登录,直到其凭据发生变化。
没有页面渲染器的服务器会返回 bi_web_unavailable。追加 bi_connection.created。使用相同 Idempotency-Key 的完全相同的重试会返回同一个响应。
参数
| 名称 | 发送 | 必需? | 描述 |
|---|---|---|---|
| ScreenRig-Project | header | 可选 | 已弃用一个版本。必须与 JWT 项目授权保持一致;添加弃用和警告头。无令牌交换。 |
| Idempotency-Key | header | 可选 | 省略以进行新操作。提供并重用密钥以去重重试;CLI 自动管理密钥。 |
请求主体字段
| 字段 | 描述 |
|---|---|
| 名称(必填,字符串) | minLength:1 maxLength:80 |
| kind(必填,字符串) | 允许:“grafana”、“powerbi”、“tableau”、“web” |
| config(必填,BIConnectionConfig) | |
| secret(可选,字符串) | 除 web 外必填,指定了 connection_id 的 Power BI 连接也不必填。服务账号令牌(Grafana)、应用的客户端密钥值(Power BI)、已连接应用的密钥值(Tableau)或服务账号的密码(web:login_mode 为 auto 时必填,none 不使用)。 到达时即加密封存;CLI 从文件或标准输入读取,绝不从参数读取。minLength: 1 maxLength: 4096 |
| totp_secret(可选,字符串) | Web:账号身份验证器应用的 base32 密钥(16 到 128 个字符,可含空格),或其 otpauth://totp 地址,后者可设置算法(SHA1、SHA256、SHA512)、位数(6 到 8)和周期。加密封存;只有计算出的验证码会离开服务器。maxLength: 1024 |
| cookies (可选, array) | Web:从已登录浏览器导出的 Cookie 集。加密封存;每次截图都会续期。 |
请求模板和响应
curl --request POST --header 'Authorization: Bearer [SCREENRIG_TOKEN]' --cookie cookies.txt --cookie-jar cookies.txt --header 'Content-Type: application/json' --data '@request.json' 'https://screenrig.ai/api/bi-connections'响应
| 状态 | 含义 | 正文和头部 |
|---|---|---|
| 201 | 已创建。 | BIConnection(application/json);头信息:ETag, Cache-Control |
| 400 | invalid_request,包括不是公共互联网主机的地址。 | 问题 (application/problem+json) |
| 402 | feature_not_in_plan — 项目的计划不包含 BI 仪表板;required_plan 指明包含它的计划。 | 问题 (application/problem+json) |
| 409 | idempotency_mismatch;在没有页面渲染器的服务器上,Web 连接会返回 bi_web_unavailable。 | 问题 (application/problem+json) |
| 默认 | 稳定的 RFC 9457 问题响应。421 server_draining 携带 1 秒的 Retry-After,500 not_ready 或 dependency_unavailable 携带 5 秒,500 manifest_degraded 携带 60 秒,除非处理程序设置了更具体的值。 | 问题 (application/problem+json) |
获取 BI 连接
一个连接及其最近一次测试。
参数
| 名称 | 发送 | 必需? | 描述 |
|---|---|---|---|
| ScreenRig-Project | header | 可选 | 已弃用一个版本。必须与 JWT 项目授权保持一致;添加弃用和警告头。无令牌交换。 |
| id | 路径 | 必填 |
请求模板和响应
curl --request GET --header 'Authorization: Bearer [SCREENRIG_TOKEN]' --cookie cookies.txt --cookie-jar cookies.txt 'https://screenrig.ai/api/bi-connections/RESOURCE_ID'响应
| 状态 | 含义 | 正文和头部 |
|---|---|---|
| 200 | 一个连接。 | BIConnection(application/json);头信息:ETag, Cache-Control |
| 404 | not_found. | 问题 (application/problem+json) |
| 默认 | 稳定的 RFC 9457 问题响应。421 server_draining 携带 1 秒的 Retry-After,500 not_ready 或 dependency_unavailable 携带 5 秒,500 manifest_degraded 携带 60 秒,除非处理程序设置了更具体的值。 | 问题 (application/problem+json) |
更新 BI 连接
Changes a connection's name, address, organization or secret (a sent secret replaces it; an omitted one is kept). Moving a Grafana or Tableau connection to another origin (scheme, host or port) needs the secret in the same request, answered invalid_request at secret otherwise: the stored secret is only sent to the address it was saved for.
更改地址或密钥会清除 last_test,并废弃其视图所缓存的全部渲染结果。追加 bi_connection.updated。If-Match 用于保护修订号。
参数
| 名称 | 发送 | 必需? | 描述 |
|---|---|---|---|
| ScreenRig-Project | header | 可选 | 已弃用一个版本。必须与 JWT 项目授权保持一致;添加弃用和警告头。无令牌交换。 |
| id | 路径 | 必填 | |
| If-Match | header | 可选 | 可选正资源修订。省略则写入当前资源;提供的过期修订为 revision_conflict。 |
| Idempotency-Key | header | 可选 | 省略以进行新操作。提供并重用密钥以去重重试;CLI 自动管理密钥。 |
请求主体字段
| 字段 | 描述 |
|---|---|
| 名称(可选,字符串) | minLength:1 maxLength:80 |
| config(可选,BIConnectionConfig) | |
| secret(可选,字符串) | 替换已存储的密钥。对 Web 连接,空字符串会移除密码。maxLength: 4096 |
| totp_secret(可选,字符串) | Web:替换 TOTP 密钥;空字符串会移除它。maxLength: 1024 |
| cookies (可选, array) | Web:替换 Cookie 集;空列表会移除它。 |
请求模板和响应
curl --request PATCH --header 'Authorization: Bearer [SCREENRIG_TOKEN]' --cookie cookies.txt --cookie-jar cookies.txt --header 'Content-Type: application/json' --data '@request.json' 'https://screenrig.ai/api/bi-connections/RESOURCE_ID'响应
| 状态 | 含义 | 正文和头部 |
|---|---|---|
| 200 | 更新后的连接。 | BIConnection(application/json);头信息:ETag, Cache-Control |
| 400 | invalid_request。 | 问题 (application/problem+json) |
| 402 | feature_not_in_plan — 项目的计划不包含 BI 仪表板;required_plan 指明包含它的计划。仅替换密钥(以及随之使用的 Tableau secret_id)的更改始终允许,因此令牌已过期的连接仍保持最新。 | 问题 (application/problem+json) |
| 412 | revision_conflict。 | 问题 (application/problem+json) |
| 默认 | 稳定的 RFC 9457 问题响应。421 server_draining 携带 1 秒的 Retry-After,500 not_ready 或 dependency_unavailable 携带 5 秒,500 manifest_degraded 携带 60 秒,除非处理程序设置了更具体的值。 | 问题 (application/problem+json) |
删除 BI 连接
删除没有任何视图使用的连接;仍有视图使用时,返回 resource_conflict 并列出这些视图的 id。追加 bi_connection.deleted。If-Match 用于保护修订号。
参数
| 名称 | 发送 | 必需? | 描述 |
|---|---|---|---|
| ScreenRig-Project | header | 可选 | 已弃用一个版本。必须与 JWT 项目授权保持一致;添加弃用和警告头。无令牌交换。 |
| id | 路径 | 必填 | |
| If-Match | header | 可选 | 可选正资源修订。省略则写入当前资源;提供的过期修订为 revision_conflict。 |
| Idempotency-Key | header | 可选 | 省略以进行新操作。提供并重用密钥以去重重试;CLI 自动管理密钥。 |
请求模板和响应
curl --request DELETE --header 'Authorization: Bearer [SCREENRIG_TOKEN]' --cookie cookies.txt --cookie-jar cookies.txt 'https://screenrig.ai/api/bi-connections/RESOURCE_ID'响应
| 状态 | 含义 | 正文和头部 |
|---|---|---|
| 204 | 已删除。 | 无正文 |
| 409 | resource_conflict:有视图正在使用该连接。 | 问题 (application/problem+json) |
| 412 | revision_conflict。 | 问题 (application/problem+json) |
| 默认 | 稳定的 RFC 9457 问题响应。421 server_draining 携带 1 秒的 Retry-After,500 not_ready 或 dependency_unavailable 携带 5 秒,500 manifest_degraded 携带 60 秒,除非处理程序设置了更具体的值。 | 问题 (application/problem+json) |
测试 BI 连接
Calls the BI system with the connection's secret and stores the answer as last_test. For Grafana the checks are token (GET /api/search accepts it) and image_renderer (the plugin is listed; a missing plugin is a warning because a remote rendering service does not show as one).
它不判定各仪表板的权限、数据源的健康状况或远程渲染器是否可达:请测试视图以真正渲染。Grafana 的拒绝只是检查失败,不是错误。
For Power BI the checks are token (Microsoft Entra accepts the app) and workspaces (the app can list workspaces; it counts them and none fails the check, naming the workspace access step). It does not judge capacity, row-level security or access to any one report: test a view, which generates a real embed token.
For Tableau the check is signin: Tableau accepts a content-read JWT signed with the connected app secret for the connection user, and the server signs out again. It does not judge the domain allowlist, which only a screen loading a view proves, or the permissions on any view: test a view, which looks the view up as the user.
参数
| 名称 | 发送 | 必需? | 描述 |
|---|---|---|---|
| ScreenRig-Project | header | 可选 | 已弃用一个版本。必须与 JWT 项目授权保持一致;添加弃用和警告头。无令牌交换。 |
| id | 路径 | 必填 | |
| Idempotency-Key | header | 可选 | 省略以进行新操作。提供并重用密钥以去重重试;CLI 自动管理密钥。 |
请求模板和响应
curl --request POST --header 'Authorization: Bearer [SCREENRIG_TOKEN]' --cookie cookies.txt --cookie-jar cookies.txt 'https://screenrig.ai/api/bi-connections/RESOURCE_ID/test'响应
| 状态 | 含义 | 正文和头部 |
|---|---|---|
| 200 | 检查项。 | BITestReport(application/json);头信息:Cache-Control |
| 404 | not_found. | 问题 (application/problem+json) |
| 默认 | 稳定的 RFC 9457 问题响应。421 server_draining 携带 1 秒的 Retry-After,500 not_ready 或 dependency_unavailable 携带 5 秒,500 manifest_degraded 携带 60 秒,除非处理程序设置了更具体的值。 | 问题 (application/problem+json) |
浏览 BI 连接
列出该连接的令牌可展示的内容。Grafana:其仪表板(query 搜索标题;next_cursor 用于翻页);设置 dashboard 后,则在 dashboard 下返回该仪表板的面板(行已展平)。
Power BI:应用能看到的工作区(id、name;query 保留名称中包含它的项);设置 workspace 后,则在 workspace 下返回该工作区的报表(id、name、embed_url)。
Tableau:连接用户能看到的视图(路径形如 Workbook/View,name),每读取一页 100 个;query 保留名称或路径包含它的视图,最多读取十页来查找,next_cursor 是下一页要读取的页。Web 连接不列出任何内容。
参数
| 名称 | 发送 | 必需? | 描述 |
|---|---|---|---|
| ScreenRig-Project | header | 可选 | 已弃用一个版本。必须与 JWT 项目授权保持一致;添加弃用和警告头。无令牌交换。 |
| id | 路径 | 必填 | |
| 查询 | 查询 | 可选 | |
| 仪表板 | 查询 | 可选 | 仪表板 uid;列出其面板。 |
| 工作区 | 查询 | 可选 | Power BI 工作区 id;列出其报表。 |
| 游标 | 查询 | 可选 | 上一页的 next_cursor。 |
请求模板和响应
curl --request GET --header 'Authorization: Bearer [SCREENRIG_TOKEN]' --cookie cookies.txt --cookie-jar cookies.txt 'https://screenrig.ai/api/bi-connections/RESOURCE_ID/browse'响应
| 状态 | 含义 | 正文和头部 |
|---|---|---|
| 200 | 仪表板或面板。 | BIBrowse(application/json);头信息:Cache-Control |
| 409 | bi_upstream_refused:BI 系统拒绝了该连接的凭据或权限。 | 问题 (application/problem+json) |
| 500 | bi_upstream_unavailable。 | 问题 (application/problem+json) |
| 默认 | 稳定的 RFC 9457 问题响应。421 server_draining 携带 1 秒的 Retry-After,500 not_ready 或 dependency_unavailable 携带 5 秒,500 manifest_degraded 携带 60 秒,除非处理程序设置了更具体的值。 | 问题 (application/problem+json) |
列出 BI 视图
Lists the project's BI views, oldest first, 200 to a page; pass next_cursor back as cursor for the next. Each carries embed_url, the address an iframe primitive shows (content_fit fill); it is null where this server has no embed host.
参数
| 名称 | 发送 | 必需? | 描述 |
|---|---|---|---|
| ScreenRig-Project | header | 可选 | 已弃用一个版本。必须与 JWT 项目授权保持一致;添加弃用和警告头。无令牌交换。 |
| 游标 | 查询 | 可选 | 上一页的 next_cursor。 |
| 限制 | 查询 | 可选 |
请求模板和响应
curl --request GET --header 'Authorization: Bearer [SCREENRIG_TOKEN]' --cookie cookies.txt --cookie-jar cookies.txt 'https://screenrig.ai/api/bi-views'响应
| 状态 | 含义 | 正文和头部 |
|---|---|---|
| 200 | 一页视图。 | BIViewList(application/json);头信息:Cache-Control |
| 400 | invalid_request,包括格式错误的游标。 | 问题 (application/problem+json) |
| 默认 | 稳定的 RFC 9457 问题响应。421 server_draining 携带 1 秒的 Retry-After,500 not_ready 或 dependency_unavailable 携带 5 秒,500 manifest_degraded 携带 60 秒,除非处理程序设置了更具体的值。 | 问题 (application/problem+json) |
创建 BI 视图
添加连接的 Grafana 仪表板或其中某一个面板的视图(url:连接主机上的 /d/{uid}/... 地址,或 target),或 Grafana 公开仪表板链接的视图(kind grafana 和 target.public_url,无需连接)。
Put the answer's embed_url in an iframe primitive: the server renders the dashboard as a PNG through Grafana's /render API, refreshed every refresh_s (30 to 86400, default 300) and shared by every screen of the same size; the screen never talks to Grafana. A public dashboard plays live from Grafana, which must allow embedding.
嵌入页面只显示屏幕清单所携带的票据,因此视图只会在其所属项目的屏幕上播放。
For Power BI (kind powerbi): a report of a workspace the connection's app is a member of (url: an app.powerbi.com /groups/{workspace}/reports/{report} address, or target with workspace_id and report_id), with pages to show and rotate_s to rotate through them (pages listing two or more, or rotate_all_pages, need rotate_s of 10 to 3600; one report page needs none), and refresh_s of 0 (no refresh) or 60 to 86400 (default 300).
The page asks the server for a short-lived view-only embed token (GenerateToken, App owns data) and renews it before it expires; the screen never holds the client secret. A Power BI Publish to web link is a view without a connection (kind powerbi, target.public_url https://app.powerbi.com/view?r=...), framed as it is.
For Tableau (kind tableau): a view of the connection site (url: an address copied from Tableau, such as https://HOST/t/SITE/views/WORKBOOK/VIEW or Tableau Cloud https://HOST/#/site/SITE/views/WORKBOOK/VIEW, or Workbook/View; or target.view), optionally with target.rotate_sheets and rotate_s of 10 to 3600 to turn the workbook published sheets (rotate_s and rotate_sheets go together; rotate_sheets may be given as the whole target beside url), and refresh_s of 0 (no refresh) or 60 to 86400 (default 300).
The page asks the server for a five minute JWT with only the embed scope, signed with the connected app secret, and builds the Embedding API v3 tableau-viz from the Tableau host; the screen never holds the secret.
Tableau Public 可视化是不带连接的视图(kind tableau、target.public_url,重建为 https://public.tableau.com/views/WORKBOOK/VIEW),同样接受 rotate_sheets。对于网页(kind web):Web 连接所属网站的一个页面(url:公共主机上的 https 地址,不带 target)。
边缘的浏览器以已登录状态打开它,如果设置了 wait_for 就等待该元素,并等待 wait_ms 毫秒(最多 10000),然后绘制 clip(一个 CSS 选择器)所指的部分(如果设置了),否则绘制整个页面。
图片每 refresh_s(60 到 86400,默认 300)重新绘制一次,由所有尺寸相同的屏幕共享,并且只在有屏幕显示该视图时才绘制;截图失败时,最后一张图片会留在屏幕上。把 wait_for 设为只有页面已登录时才存在的元素,这样就绝不会显示登录页面。追加 bi_view.created。
参数
| 名称 | 发送 | 必需? | 描述 |
|---|---|---|---|
| ScreenRig-Project | header | 可选 | 已弃用一个版本。必须与 JWT 项目授权保持一致;添加弃用和警告头。无令牌交换。 |
| Idempotency-Key | header | 可选 | 省略以进行新操作。提供并重用密钥以去重重试;CLI 自动管理密钥。 |
请求主体字段
| 字段 | 描述 |
|---|---|
| connection_id(可选,字符串) | |
| kind(可选,字符串) | 没有 connection_id 时必填;否则必须与该连接一致。允许:“grafana”、“powerbi”、“tableau”、“web” |
| 名称(必填,字符串) | minLength:1 maxLength:80 |
| url(可选,字符串) | 连接所在主机上的 /d/{uid}/... 仪表板地址。服务器会从中读取 orgId、viewPanel(N 或 panel-N)或 panelId、from、to、var-* 和 theme。Tableau:连接所在主机上的视图地址(/views/W/V、/t/SITE/views/W/V、#/site/SITE/views/W/V)或 Workbook/View。Web:公共主机上页面的 https 地址。maxLength: 2048 |
| target(可选,BITarget) | 视图显示的内容。带连接的 Grafana:dashboard_uid(以及可选的单个面板)。带连接的 Power BI:workspace_id 和 report_id,以及 pages 或 rotate_all_pages。带连接的 Tableau:view(Workbook/View),以及 rotate_sheets。带连接的 Web:url。不带连接时:只有 public_url(Tableau 还有 rotate_sheets)。 |
| refresh_s(可选,整数) | Grafana 为 30 到 86400;Power BI 和 Tableau 为 0 或 60 到 86400;web 为 60 到 86400。default: 300 minimum: 0 maximum: 86400 |
| rotate_s(可选,整数) | Power BI 和 Tableau:0 或 10 至 3600;轮换页面或工作表的目标必填。default: 0 minimum: 0 maximum: 3600 |
| fit(可选,字符串) | 允许:"contain", "cover", "fill" 默认值:"contain" |
| wait_for(可选,字符串) | Web:一个元素的 CSS 选择器,该元素在页面就绪时出现,并且只在已登录时出现。maxLength: 512 |
| wait_ms(可选,整数) | Web:页面就绪后要等待的毫秒数。minimum: 0 maximum: 10000 |
| clip(可选,字符串) | Web:要绘制的页面部分的 CSS 选择器。maxLength: 512 |
请求模板和响应
curl --request POST --header 'Authorization: Bearer [SCREENRIG_TOKEN]' --cookie cookies.txt --cookie-jar cookies.txt --header 'Content-Type: application/json' --data '@request.json' 'https://screenrig.ai/api/bi-views'响应
| 状态 | 含义 | 正文和头部 |
|---|---|---|
| 201 | 已创建。 | BIView(application/json);头信息:ETag, Cache-Control |
| 400 | invalid_request,包括不是该连接的仪表板地址的 url。 | 问题 (application/problem+json) |
| 402 | feature_not_in_plan — 项目的计划不包含 BI 仪表板;required_plan 指明包含它的计划。 | 问题 (application/problem+json) |
| 404 | not_found:该连接不在此项目中。 | 问题 (application/problem+json) |
| 409 | idempotency_mismatch. | 问题 (application/problem+json) |
| 默认 | 稳定的 RFC 9457 问题响应。421 server_draining 携带 1 秒的 Retry-After,500 not_ready 或 dependency_unavailable 携带 5 秒,500 manifest_degraded 携带 60 秒,除非处理程序设置了更具体的值。 | 问题 (application/problem+json) |
获取 BI 视图
一个视图,含 embed_url 及其上次在屏幕上的表现(status)。
参数
| 名称 | 发送 | 必需? | 描述 |
|---|---|---|---|
| ScreenRig-Project | header | 可选 | 已弃用一个版本。必须与 JWT 项目授权保持一致;添加弃用和警告头。无令牌交换。 |
| id | 路径 | 必填 |
请求模板和响应
curl --request GET --header 'Authorization: Bearer [SCREENRIG_TOKEN]' --cookie cookies.txt --cookie-jar cookies.txt 'https://screenrig.ai/api/bi-views/RESOURCE_ID'响应
| 状态 | 含义 | 正文和头部 |
|---|---|---|
| 200 | 一个视图。 | BIView(application/json);头信息:ETag, Cache-Control |
| 404 | not_found. | 问题 (application/problem+json) |
| 默认 | 稳定的 RFC 9457 问题响应。421 server_draining 携带 1 秒的 Retry-After,500 not_ready 或 dependency_unavailable 携带 5 秒,500 manifest_degraded 携带 60 秒,除非处理程序设置了更具体的值。 | 问题 (application/problem+json) |
更新 BI 视图
Changes a view's name, target (url or target replaces the whole target), cadence or fit. A new target clears status, and every render cached for the old one is retired. A view keeps its connection and kind. Appends bi_view.updated. If-Match guards the revision.
参数
| 名称 | 发送 | 必需? | 描述 |
|---|---|---|---|
| ScreenRig-Project | header | 可选 | 已弃用一个版本。必须与 JWT 项目授权保持一致;添加弃用和警告头。无令牌交换。 |
| id | 路径 | 必填 | |
| If-Match | header | 可选 | 可选正资源修订。省略则写入当前资源;提供的过期修订为 revision_conflict。 |
| Idempotency-Key | header | 可选 | 省略以进行新操作。提供并重用密钥以去重重试;CLI 自动管理密钥。 |
请求主体字段
| 字段 | 描述 |
|---|---|
| 名称(可选,字符串) | minLength:1 maxLength:80 |
| url(可选,字符串) | maxLength: 2048 |
| target(可选,BITarget) | 视图显示的内容。带连接的 Grafana:dashboard_uid(以及可选的单个面板)。带连接的 Power BI:workspace_id 和 report_id,以及 pages 或 rotate_all_pages。带连接的 Tableau:view(Workbook/View),以及 rotate_sheets。带连接的 Web:url。不带连接时:只有 public_url(Tableau 还有 rotate_sheets)。 |
| refresh_s(可选,整数) | 最小值:0 最大值:86400 |
| rotate_s(可选,整数) | 最小值:0 最大值:3600 |
| fit(可选,字符串) | 允许:"contain", "cover", "fill" |
| wait_for(可选,字符串) | Web:空字符串会移除它。maxLength: 512 |
| wait_ms(可选,整数) | Web:0 会移除它。minimum: 0 maximum: 10000 |
| clip(可选,字符串) | Web:空字符串会移除它。maxLength: 512 |
请求模板和响应
curl --request PATCH --header 'Authorization: Bearer [SCREENRIG_TOKEN]' --cookie cookies.txt --cookie-jar cookies.txt --header 'Content-Type: application/json' --data '@request.json' 'https://screenrig.ai/api/bi-views/RESOURCE_ID'响应
| 状态 | 含义 | 正文和头部 |
|---|---|---|
| 200 | 更新后的视图。 | BIView(application/json);头信息:ETag, Cache-Control |
| 400 | invalid_request。 | 问题 (application/problem+json) |
| 402 | feature_not_in_plan — 项目的计划不包含 BI 仪表板;required_plan 指明包含它的计划。 | 问题 (application/problem+json) |
| 412 | revision_conflict。 | 问题 (application/problem+json) |
| 默认 | 稳定的 RFC 9457 问题响应。421 server_draining 携带 1 秒的 Retry-After,500 not_ready 或 dependency_unavailable 携带 5 秒,500 manifest_degraded 携带 60 秒,除非处理程序设置了更具体的值。 | 问题 (application/problem+json) |
删除 BI 视图
删除视图。仍显示其 embed_url 的屏幕在其播放列表更改前,会在屏幕上返回 not_found。追加 bi_view.deleted。If-Match 用于保护修订号。
参数
| 名称 | 发送 | 必需? | 描述 |
|---|---|---|---|
| ScreenRig-Project | header | 可选 | 已弃用一个版本。必须与 JWT 项目授权保持一致;添加弃用和警告头。无令牌交换。 |
| id | 路径 | 必填 | |
| If-Match | header | 可选 | 可选正资源修订。省略则写入当前资源;提供的过期修订为 revision_conflict。 |
| Idempotency-Key | header | 可选 | 省略以进行新操作。提供并重用密钥以去重重试;CLI 自动管理密钥。 |
请求模板和响应
curl --request DELETE --header 'Authorization: Bearer [SCREENRIG_TOKEN]' --cookie cookies.txt --cookie-jar cookies.txt 'https://screenrig.ai/api/bi-views/RESOURCE_ID'响应
| 状态 | 含义 | 正文和头部 |
|---|---|---|
| 204 | 已删除。 | 无正文 |
| 412 | revision_conflict。 | 问题 (application/problem+json) |
| 默认 | 稳定的 RFC 9457 问题响应。421 server_draining 携带 1 秒的 Retry-After,500 not_ready 或 dependency_unavailable 携带 5 秒,500 manifest_degraded 携带 60 秒,除非处理程序设置了更具体的值。 | 问题 (application/problem+json) |
测试 BI 视图
Renders a connection view for real (1920x1080, outside the shared cache and without touching status), or fetches a public dashboard link and checks that its page may be framed by the view's embed host (allow_embedding in Grafana). It does not judge what the picture shows. A Grafana failure is a failed check, not an error.
Power BI 连接视图会为其报表生成真实的嵌入令牌(检查 report 和 embed_token);它不判定所指定的页面、容量或报表所显示的内容,带行级安全的数据集会被 Power BI 以其自身的消息拒绝,并显示在检查结果中。Power BI 公开链接会被获取,并读取其嵌入框架相关的响应头。
Tableau 连接视图会以连接用户身份登录并查找该视图(检查 signin 和 view);它不判定域名允许列表、嵌入权限或视图所显示的内容。Tableau Public 视图会向 Tableau Public 询问工作簿是否存在,不判定视图名称。
参数
| 名称 | 发送 | 必需? | 描述 |
|---|---|---|---|
| ScreenRig-Project | header | 可选 | 已弃用一个版本。必须与 JWT 项目授权保持一致;添加弃用和警告头。无令牌交换。 |
| id | 路径 | 必填 | |
| Idempotency-Key | header | 可选 | 省略以进行新操作。提供并重用密钥以去重重试;CLI 自动管理密钥。 |
请求模板和响应
curl --request POST --header 'Authorization: Bearer [SCREENRIG_TOKEN]' --cookie cookies.txt --cookie-jar cookies.txt 'https://screenrig.ai/api/bi-views/RESOURCE_ID/test'响应
| 状态 | 含义 | 正文和头部 |
|---|---|---|
| 200 | 检查项。 | BIViewTest(application/json);头信息:Cache-Control |
| 404 | not_found. | 问题 (application/problem+json) |
| 默认 | 稳定的 RFC 9457 问题响应。421 server_draining 携带 1 秒的 Retry-After,500 not_ready 或 dependency_unavailable 携带 5 秒,500 manifest_degraded 携带 60 秒,除非处理程序设置了更具体的值。 | 问题 (application/problem+json) |
获取 BI 视图图像
立即把 Grafana 或 Web 视图绘制成 PNG(Power BI 或 Tableau 视图返回 not_found),不经过共享缓存,因此测试能准确显示 Grafana 或浏览器在该尺寸下渲染的内容。嵌入页面本身使用共享渲染。
参数
| 名称 | 发送 | 必需? | 描述 |
|---|---|---|---|
| ScreenRig-Project | header | 可选 | 已弃用一个版本。必须与 JWT 项目授权保持一致;添加弃用和警告头。无令牌交换。 |
| id | 路径 | 必填 | |
| 宽度 | 查询 | 可选 | |
| 高度 | 查询 | 可选 |
请求模板和响应
curl --request GET --header 'Authorization: Bearer [SCREENRIG_TOKEN]' --cookie cookies.txt --cookie-jar cookies.txt 'https://screenrig.ai/api/bi-views/RESOURCE_ID/image'响应
| 状态 | 含义 | 正文和头部 |
|---|---|---|
| 200 | 渲染后的 PNG。 | string(image/png);头信息:Cache-Control |
| 409 | bi_upstream_refused:BI 系统拒绝了该连接的凭据或权限。 | 问题 (application/problem+json) |
| 500 | bi_upstream_unavailable,包括未安装图像渲染器的 Grafana。 | 问题 (application/problem+json) |
| 默认 | 稳定的 RFC 9457 问题响应。421 server_draining 携带 1 秒的 Retry-After,500 not_ready 或 dependency_unavailable 携带 5 秒,500 manifest_degraded 携带 60 秒,除非处理程序设置了更具体的值。 | 问题 (application/problem+json) |