Skip to content

fix: build the Share embed snippet for a view - #1933

Open
ranjithguggilla wants to merge 1 commit into
tableau:developmentfrom
ranjithguggilla:fix/996-view-embed-code
Open

ranjithguggilla wants to merge 1 commit into
tableau:developmentfrom
ranjithguggilla:fix/996-view-embed-code

Conversation

@ranjithguggilla

Copy link
Copy Markdown

Closes #996

Motivation

There is no REST method that returns the embed HTML from a view's Share button. The snippet is built from the view URL. Jac Fitzgerald noted that adding it would be useful. The issue is labeled ui-exists because the UI has the snippet and the REST API does not.

Behavior change

views.embed_code(view) returns that HTML for the signed-in site.

  • REST API 3.13 and later (Tableau 2021.4, when the Embedding API v3 is available): a tableau-viz element and tableau.embedding.3.latest.min.js, which is what the Share button copies from Tableau 2022.3 onward.
  • Older servers: the JavaScript API object embed that loads viz_v1.js.

A named site uses /t/{site}/views/{workbook}/{view}. The default site uses /views/{workbook}/{view}.

Test plan

Three tests cover the legacy snippet, the v3 snippet on the default site, and the v3 snippet on a named site.

Not covered: pasting the snippet into a browser against a Tableau site.

The REST API does not return the embed HTML from the Share button.
views.embed_code builds it from the view URL: the Embedding API v3
component on REST API 3.13 and later, and the JavaScript API object
embed on older servers.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

get the Embed code of the workbook views

1 participant