Qlik Community

Ask a Question

Integration, Extension & APIs

Discussion board where members can learn more about Integration, Extensions and API’s for Qlik Sense.

Announcements
Support Cases coming to Qlik Community Oct. 4! Start chats, open cases, explore resources: READ DETAILS
cancel
Showing results for 
Search instead for 
Did you mean: 
apinheiro90
Contributor
Contributor

How do i Use Qlik Nprinting API to generate a report on a Mashup

Hello everyone,

I've been trying to create a logic that allows me to generate a Nprinting report using the Qlik Nprinting API by clicking a button on my mashup (something similar to the extension that exists but that works on a mashup framework):

I've already checked the option of on demand request on the nprinting server.

teste1.PNG

Below you'll find my Javascript code for this button. The login works fine and the connection is made so i assume there is some wrong syntax:

$scope.Teste = function(){

           var URL = 'https://SERVERNAME/'+ 'api/v1/login/ntlm'

return $.ajax({

url: URL,

method: 'GET',

xhrFields: {

withCredentials: true

}

}).done(function(data) {

               $.ajax({

                        type: "POST",

                        url: 'https://SERVERNAME/api/v1/ondemand/requests/',

                        xhrFields: {

                            withCredentials: true

                        },

                        contentType: 'application/json',

                        data: {

                        type: 'report',

                        config: {

                            reportId: '51eed116-78df-4cee-9270-1a17bf60a005',

                            outputFormat: 'xls'

                        }

                        }

       }).done(function(data) {

                    console.log(data);

                    });

});

};

Right now i'm just trying to get a static report that exists on the server but i'm getting error 400: Bad request.

Thank you

1 Reply
microland
Contributor III
Contributor III

Hi,

Facing the same issue, do u have any solution to this?