2 Replies Latest reply: Jan 17, 2016 7:33 AM by Daniel Balchasan RSS

    Import app example

    Daniel Balchasan

      Hey Everyone,

       

      I'm trying to get started working with the Qlik API. I'm connecting using curl (through a groovy script).

      So far I was able to run GET requests, but I've been running into issues when try to do an import through the API.

       

      First I got an issue with the content type. The documentation says it should be a string but I got errors saying it expects a application/json and not text/plain

      Now I'm having issues parsing the properties.

       

      Can some give me an example of importing an app using the API?

        • Re: Import app example
          Konrad Mattheis

          Hi,

           

          i think curl is not the right tool to do that stuff.

           

          bye

          Konrad

            • Re: Import app example
              Daniel Balchasan

              Thanks for your reply, but I figured it out.

              Looks like the main issue was that the call needs to get a normal string, but is also expecting "Content-Type: application/json". Took me a lot of trial and error to get it right, but it works now.

               

              curl -X POST

              --cert "{certificate_location}"

              --key "{certificate_key_location}"

              -k

              {server_url}/qrs/app/import?xrfkey=0123456789abcdef&name=test_import

              --header "x-qlik-xrfkey: 0123456789abcdef"

              --header "X-Qlik-User: UserDirectory=internal;UserId=sa_repository"

              --header "Content-Type: application/json"

              -d 'test.qvf'