1 Reply Latest reply: Jun 19, 2018 5:47 AM by Ivan FELIPE ASENSIO RSS

    QPS API - Session - Get User

    Sean Anderson

      Problem: QPS API session REST API GET returns 500.

       

      Example session module root:

      http://thehost/qps

       

      1) The following http GET returns expected JSON:

      http://thehost/qps/user


      Returns:

      {"userDirectory": "THE_DOMAIN", "userId": "myUserId", "userName": "Me", "logoutUri": "http://thehost/qps/user"}

       

      2) ..However the following http GET gives me a 500:

      500 (No rest method matches the incoming request)

      http://thehost/qps/user/THE_DOMAIN/Me


      Spec:

      https://help.qlik.com/en-US/sense-developer/June2017/Subsystems/ProxyServiceAPI/Content/ProxyServiceAPI/ProxyServiceAPI-…


      Ideas?

        • Re: QPS API - Session - Get User
          Ivan FELIPE ASENSIO

          You typed this so long ago, but I wanted to offer a trick for doing that, if you still need it:


          var app = qlik.currApp();

          app.model.enigmaModel.evaluate('OSUser()').then(function(reply){ 

                console.log(reply); //reply will contain a string like UserDirectory=QLIKDOMAIN; UserId=userIvan (in my case)

          });


          This code will evaluate the OSUser() expression, which is not in the API but is present in the frontend.

          Regards