5 Replies Latest reply: Sep 28, 2016 6:23 AM by Andres Prado RSS

    QlikSense QMC API using http requests (REST API)

    Gustav Gager

      Hi everyone.

      Im currently wrinting a small program in a language called Autoit. Its a Script based programing language that can be used to automate Windows tasks. The syntax is very similar to VB for exmple.

      I have used this language several times to automate stuff in Qlikview desktop usiong the COM API and it worked well.

       

      Just for the fun of it, im trying to get a connection to the Qlik Sense QMC. The idee is to get some basic info about the server. Like users, tokens, tasks and stuff like that. However im not having mutch luck.This is my simple code so far.

       

      $objHTTP = ObjCreate("winhttp.winhttprequest.5.1")

      $objHTTP.open ("GET", "http://localhost/qrs/user/count", False)

      $objHTTP.setRequestHeader ("Content-Type", "application/json")

      $objHTTP.setRequestHeader("Accept","application/json")

      $objHTTP.setRequestHeader("x-qlik-xrfkey","0123456789abcdef")

      $objHTTP.send()

      ConsoleWrite($objHTTP.responseText & @CRLF)

       

      The response text i get is HTML and if i pipe it to an html file, i get a page that ask me to logon (since its s static HTML page, i cannot logon).

      I was under the impression that if you used the proxy URL and not the API directly, you could use the current logged on user to get the access you need. If i just browse to http://localhost/hub im loged on without ever needing to add more credeentials.

       

      So the question is how to proceed? I have tried reading the documentation (https://help.qlik.com/sense/1.0/en-us/developer/Subsystems/Qlik_Sense_Repository_Service_API/Content/QRS%20API/Repositor…) but that didnt get me anywhere. I even did the example connection using MS Powershell and i got the EXACT same response I did with the code above.

       

      Help needed

      /G