Access to photos Tableau Public when EpiCollect project is Private mode

I currently use Tableau Public to analyse and present EpiCollect data and also to let people view photos collected. This works well while the project is in “Public” mode but stops working when in “Private” mode. Is there any way around this (i.e. can links to photos be made to work while in Private mode, if necessary via a log in?)?

To test this I set up a test project “Michael C test”. When this is in public mode, the photo links work within Tableau Public. But in private mode the photos no longer appear and I get the message “{“errors”:[{“code”:“ec5_77”,“title”:“This project is private. Please log in.”,“source”:“middleware”}]}”in the Tableau Public window. This happens even if I’m logged in to EpiCollect within the same browser.

Any advice welcome!

Michael

Hi,

what you are experiencing is the correct behaviour.
Without authentication, a third-party client (Tableau in this instance) can’t access a private project.

The API authentication is separate from the user authentication, so it does not matter whether or not you are logged in to Epicollect5 in your browser.

If you look at our docs here →

you will see you need to create the client ID and client Secret for that project, use those credentials to get a temporary token and provide that token to all requests made by Tableau.
More info with examples in our Developer Guide →

We do not have any experience with Tableau but we assume it should be possible to add an authorization header to its external requests since it is pretty common.

just remember each token lasts for 2 hours, after that, you will need to request a new one. In our docs, we provide a few examples.

We hope this helps

In Tableau, you can add an authorization header to external requests by leveraging Tableau’s ability to connect to web data connectors (WDC). Web data connectors allow you to create custom data connections to web services or APIs that require authentication.

To add an authorization header to external requests in Tableau using a web data connector, follow these general steps:

  1. Create a Web Data Connector (WDC):

    • Develop a web data connector using HTML, JavaScript, and Tableau’s WDC JavaScript library. The WDC should handle the authentication process and include the necessary authorization header in the requests.
    • You can find the Tableau WDC SDK and documentation on the Tableau website.
  2. Host the WDC:

    • Once you’ve created the WDC, you need to host it on a web server or a service that can serve the connector over HTTPS. This can be a local development server or a cloud-based hosting platform.
  3. Connect to the WDC in Tableau:

    • Open Tableau Desktop and go to the “Web Data Connector” option in the “Connect” menu.
    • Enter the URL of your hosted WDC in the provided input field and click “Connect.”
  4. Authenticate and Configure:

    • Your WDC should prompt you for any necessary authentication details, such as API keys, access tokens, or username/password credentials.
    • Once authenticated, your WDC can present you with any configuration options to tailor the data request to your needs.
  5. Import Data:

    • After authentication and configuration, you can import the data into Tableau as you would with any other data source.

By using a custom web data connector, you can have full control over the authorization process, including adding custom headers to your external requests. The WDC acts as an intermediary between Tableau and the external API, allowing you to pass authentication tokens or API keys securely.

Keep in mind that the exact steps and implementation will depend on the specific API or service you’re trying to connect to and its authentication requirements. Always refer to the API documentation and Tableau’s WDC SDK documentation for more detailed guidance.