2 Replies Latest reply on Jul 5, 2018 11:36 PM by Kevin Baumer

    API no permission

    Kevin Baumer

      Hello!

       

      I embedded my dashboard on my webpage using the following given basic embed code, which works fine:

       

      <script type="text/javascript" src="https://public.tableau.com/javascripts/api/tableau-2.min.js"></script> <script type="text/javascript"> function initViz() { var containerDiv = document.getElementById("vizContainer"), url = "http://public.tableau.com/views/RegionalSampleWorkbook/Storms", options = { hideTabs: true, onFirstInteractive: function () { console.log("Run this code when the viz has finished loading."); } };  var viz = new tableau.Viz(containerDiv, url, options); // Create a viz object and embed it in the container div. } </script>

      But if the person on the webpage, doesn`t have the permission to view the dashboard, the page is just empty showing nothing or sometimes showing an error message "Resource not found".

       

      Is it possible in any way, to check if the dashboard is displayed correctly and if not, to set a personalized message or image like : "Sorry, but your user account doesn`t have the permission to view this dashboard".

       

      I found out that there is an error code enum "downloadWorkbookNotAllowed" in the Javascript API of Tableau, but I am not sure how I can use it.

       

      Thanks for your help in advance!