How do I call QlikSense APIs with curl (QMC Task load)

    Hello all

    As I am a newbie with PowerShell, and always reluctant to add some complementary tools (eg Qlik-Cli), i tried to call APIs by using curl

    . As I have been frustrated by the doc in the support website, here is the procedure to make things work . Hope it will help some..

    The goal is actually to run a Task Load in the QMC


    Install Curl

    Can be useful ;-)

    * Curl Download Wizard

       https://curl.haxx.se/dlwiz/

    or https://curl.haxx.se/dlwiz/?type=bin&os=Win64&flav=-&ver=-&cpu=x86_64

    * doc for installing:  https://code.i-harness.com/fr/q/911219

    * Official Curl website https://curl.haxx.se/docs/httpscripting.html

     

    I installed it there :%UserProfile%\AppData\Local\curl-7.59.0-win64-mingw\bin

     

    Test

    See  https://help.qlik.com/en-US/sense-developer/September2017/Subsystems/RepositoryServiceAPI/Content/RepositoryServiceAPI/RepositoryServiceAPI-Example-Connect-cURL-Certificates.htm

    BUT there is a missing parameter:"  --key path\client_key"


    In Dos, in my bin Repository

    curl -v ^

    --location ^

    --cert C:\Users\MyUserName\..\client.pem ^

    --key C:\Users\MyUserName\..\client_key.pem ^

    --insecure https://MyQlikServerName:4242/qrs/app?xrfkey=0123456789abcdef ^

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

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


    Task Load

    See

    https://help.qlik.com/en-US/sense-developer/February2018/Subsystems/RepositoryServiceAPI/Content/RepositoryServiceAPI/RepositoryServiceAPI-Task-Start-Task.htm

    Note, for me:  /qrs/task/{id}/start/synchronous => qrs/task/{58b31b78-ad2d-456c-bc01-5356a34c6ee7}/start/synchronous

     

    In Dos, in my bin Repository

    curl -v ^

    --location ^

    --header "Transfer-Encoding: chunked" ^

    --cert C:\Users\MyUserName\..\client.pem ^

    --key C:\Users\MyUserName\..\client_key.pem ^

    --request POST ^

    --insecure https:/MyQlikServerName::4242/qrs/task/58b31b78-ad2d-456c-bc01-5356a34c6ee7/start/synchronous?xrfkey=0123456789abcdef ^

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

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



    Chrs

    Olivier