JSAPI v3 response appears to be null

Sachin Lalwani shared this question 8 days ago
Awaiting Reply

Hi,


We implemented report integration using JSAPI 2.0 in Yellowfin 8 .

We referred below url and user access section


https://wiki.yellowfinbi.com/pages/viewpage.action?pageId=37061306

https://wiki.yellowfinbi.com/display/user80/JavaScript+API


Authentication details can be passed to the API when the dashboard or report is loaded, either by passing a username and password,

or authenticating via web services and passing the login token to the API. This allows you to use a specific user to load content rather

than requiring the user to enter their details.


Ex of JSAPI is given below-


<script src="http://yfip:yfprt/mdp/JsAPI"; type="text/javascript"></script>

<script src="http://yfip:yfprt/mdp/JsAPI?api=reports"; type="text/javascript"></script>


<script type="text/javascript">


if (window.yellowfin) {


}


var options = {};


var filterValues = {};


options.username = "xxxxxx@domain.com";

options.password = "xxxxxxx";

options.clientOrg = "xyz";


options.reportUUID = "24bbe31d-7b20-4323-b9ba-c3510f792c43";

options.elementId = "myReportDiv1";

options.showTitle= "true";

options.showInfo= "true";

options.showFilters = "true";

options.showSections = "true";

options.showExport = "true";

options.fitTableWidth = "false";

options.display = "chart";

options.filters = filterValues;

yellowfin.loadReport(options);


</script>


These reports are not shared reports and we do not have guest role.

Hence , we have used username & password or we can use LoginsessionId .

This script works fine.


Question 1 -

Is there any way , without specifying credential, we can login in yellowfin and integrate reports in JSAPI 2.0 ?


Question 2 -

We are migrating from Yellowin 8 to Yelllowfin 9 .

There is no information of user acess provided for JAPI v3 as that of JSAPI v2 in web page –

https://wiki.yellowfinbi.com/display/yfcurrent/JavaScript+API+v3


Why I am not able to render or integrate report when I use JSAPI/v3 instead of JSAPI ?

Please suggest if any configuration is required to implement JSAPI v3.


Ex of JSAPI is given below-


<script src="http://yfip:yfprt/mdp/JsAPI/v3"; type="text/javascript"></script>

<script src="http://yfip:yfprt/mdp/JsAPI/v3?api=reports"; type="text/javascript"></script>


<script type="text/javascript">


if (window.yellowfin) {


}


var options = {};


var filterValues = {};


options.username = "xxxxxx@domain.com";

options.password = "xxxxxxx";

options.clientOrg = "xyz";


options.reportUUID = "24bbe31d-7b20-4323-b9ba-c3510f792c43";

options.elementId = "myReportDiv1";

options.showTitle= "true";

options.showInfo= "true";

options.showFilters = "true";

options.showSections = "true";

options.showExport = "true";

options.fitTableWidth = "false";

options.display = "chart";

options.filters = filterValues;

yellowfin.loadReport(options);


</script>

Comments (3)

photo
1

Hi Sachin,

Thank you for your question. I will start by saying that the JsAPI v3 is not just an upgrade of the existing one, it is a completely new infrastructure which provides greater control over the elements, so code from the v2 would need to be modified to work with v3. There is a reference for the JsAPI v3, but it is broken into the individual sub-api's as per their function. To start with, please review the Base API which would give you the bulk of the options available in your example:

https://wiki.yellowfinbi.com/display/yfcurrent/Base+API

The following example is a basic version of loading a report and displaying it within a page:

<script src="http://localhost:8080/JsAPI/v3?username=admin@yellowfin.com.au&password=test"></script>;
<div id="reportDiv"></div>
<script>
yellowfin.init().then(() => {
          //The Yellowfin base API has now loaded. Now load a report
          yellowfin.loadReport({
                    reportId: 'c83357db-8aef-4ec7-ab72-fce34de9ee77',
                    element: document.querySelector('div#reportDiv'),
           });
});
</script>

And to answer your first question, if you do not have a guest role, then your only options are to either authenticate via webservices or specify the credentials in the code itself.


Please let me know if you have any further questions on this and I will do my best to answer.

Cheers,

Neal

photo
1

Hi Sachin,

Hope you are well. I wanted to see if the links I sent through previously were able to help you build out what you needed? Was there anything else I can help with?

Cheers,

Neal

photo
1

Hi Sachin,

Just checking in to see if you have been able to get this working for you? Did you have any further questions?

Cheers,

Neal