Using Public DSS API in a WebApp

Options
vdwow
vdwow Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 1 ✭✭✭
edited July 16 in Using Dataiku

Hello,

I'm building a very simple web app on DSS to fetch data from a dataset. The app is basically the standard fetching app provided by Dataiku :

function clearMessage() {
    displayMessage('');
}

function displayFailure() {
    displayMessage('The dataset cannot be retrieved. Please check the dataset name or the API Key\'s permissions in the "Settings" tab of the webapp.', 'error-message');
}

function displayDataFrame(dataFrame) {
    let columnsNames = dataFrame.getColumnNames();
    let line = '------------------------------';
    let text = selectedDataset.name + '\n'
        + line + '\n'
        + dataFrame.getNbRows() + ' Rows\n'
        + columnsNames.length + ' Columns\n'
        + '\n' + line + '\n'
        + 'Columns names: \n';
    columnsNames.forEach(function(columnName) {
        text += columnName + ', ';
    });
    displayMessage(text);
}

fetchButton.addEventListener('click', function(event) {
    clearMessage();
    selectedDataset.name = document.getElementById('dataset-to-fetch').value;
    dataiku.fetch(selectedDataset.name, function(dataFrame) {
        selectedDataset.dataFrame = dataFrame;
        displayDataFrame(dataFrame);
    }, function() {
        displayFailure();
    });
    return false;
});

I've authorized the app to access the particular dataset (read / write) but i keep getting the following message (default message in default DSS web app) :

"The dataset cannot be retrieved. Please check the dataset name or the API Key's permissions in the "Settings" tab of the webapp."

Is there something else to do after authorizing the app to access the dataset ?

Thanks in advance.

Answers

  • Sarina
    Sarina Dataiker, Dataiku DSS Core Designer, Dataiku DSS Adv Designer Posts: 315 Dataiker
    Options

    Hi @vdwow
    ,

    Thank you for providing your detailed steps.

    In order to access the dataset from this base webapp, you should only need to allow access under the webapp Settings > Security > configure settings:

    Screen Shot 2021-03-30 at 12.16.43 PM.png

    It sounds like you already did this.

    I would suggest just double-checking these settings and that the dataset exists exactly as you are entering it. Then as a next step, it would probably be helpful to see the exact call that the webapp is making and the corresponding error. You can do this by accessing the developer tools in Chrome (More Tools > Developer Tools) and then attempting you "Fetch" call again.

    You might notice that there is a typo in the dataset name or that the error actually originates from something else. For example, this is what I see if I try and fetch a dataset name that doesn't exist:

    Screen Shot 2021-03-30 at 12.26.27 PM.png

    If that doesn't help with identifying what might be wrong, can you please attach a screenshot of your dataset settings and the full POST call (as shown above)?

    Thanks,
    Sarina 

Setup Info
    Tags
      Help me…