12 Replies Latest reply: Aug 12, 2016 4:00 AM by Cesar Accardi RSS

    QRS API - updating users custom properties

    Cesar Accardi

      Hello,

       

      I have defined a custom property "Department" and associated to apps/users for access control. I would like to automate the process of going to QMC and manually setting the "Department" values for each user. I believe this should be possible using QRS API but as I don't have much experience with the API am not sure how to do this.

       

      I am using Postman and managed to retrieve the details of a given user as well as the custom properties associated:

       

      Request

       

      GET /qrs/user/2e04436f-a71a-45c5-999c-793a00ba6a77/?Xrfkey=ABCDEFG123456789 HTTP/1.1

      Host: myserver

      X-Qlik-Xrfkey: ABCDEFG123456789

       

      Response

      json get user by id.PNG

      In this case User 1 is associated to Finance and Sales, now let's say I wanted to move it to Executive and Sales. Can I just update the value of "Finance" to "Executive"? I have tried sending a PUT request like below but it doesn't work (it gives a 409 Conflict error message). Does anybody know why?


      PUT /qrs/user/2e04436f-a71a-45c5-999c-793a00ba6a77?Xrfkey=ABCDEFG123456789 HTTP/1.1

      Host: myserver

      X-Qlik-Xrfkey: ABCDEFG123456789

      Content-Type: application/json

       

      {

        "id": "2e04436f-a71a-45c5-999c-793a00ba6a77",

      "customProperties": [

          {

            "id": "fb5e68ec-d382-4bd1-b9f3-81c5a5f1b3e1",

            "value": "Executive"

          }

        ]

      }

       

      Thanks in advance,

       

      Cesar