5 Replies Latest reply: Mar 7, 2016 7:51 AM by Cesar Accardi RSS

    Update object with QRS API

    Ghislain FERREOL

      Hi everyone,

       

      I am working with API to build deployment and managment tools for Qlik Sense.

      I can create any kind of object, publish, clone apps, create dimensions, tags, security rules etc

      But I am encountering an issue with all updates (Qlik Sense 2.1.1)

       

      I tried two ways, with a tag exemple :

       

      -1)  With the update method :

      https://help.qlik.com/en-US/sense-developer/2.1/Subsystems/RepositoryServiceAPI/Content/RepositoryServiceAPI/RepositoryServiceAPI-Update.htm

      I am receiving a 409 Conflict error code by sending objects with same structure as received.

       

       

      Here is the codes samples :

      Qlik Sense API Update 1.png

       

      And my result :

       

      https://FNTVAQSEDEV0847.france.rexel:4242/qrs/tag?Xrfkey=0123456789abcdef&

       

      [

      {"id":"4de7822b-cadf-462b-86c2-f8f06c5d21f1","name":"MDM","privileges":null},

      {"id":"789a093d-b32c-4c5e-87d9-332a2ed835a0","name":"TestAPI","privileges":null}

      ]

       

      Update tag ...

       

      {

         "Name": "TestAPIUpdated",

         "ID": "789a093d-b32c-4c5e-87d9-332a2ed835a0",

         "ModifiedDate": "/Date(1382706746631+0200)/"

      }

      https://FNTVAQSEDEV0847.france.rexel:4242/qrs/tag/789a093d-b32c-4c5e-87d9-332a2ed835a0?Xrfkey=0123456789abcdef&

      Le serveur distant a retourné une erreur : (409) Conflit.

       

       

      2) With Update Selection method

      Help is not helpfull :

      https://help.qlik.com/en-US/sense-developer/2.1/Subsystems/RepositoryServiceAPI/Content/RepositoryServiceAPI/RepositoryS…

      Thanks to this post I could have a concrete sample :

      Using QRS to add a user to a stream

       

      Here is the request and result (no fail, ut nothing has change) :

       

       

      1) Send selection

       

      https://FNTVAQSEDEV0847.france.rexel:4242/qrs/selection/tag?Xrfkey=0123456789abcdef&filter=id eq 789a093d-b32c-4c5e-87d9-332a2ed835a0

       

      {"items":[{"objectID":"789a093d-b32c-4c5e-87d9-332a2ed835a0","type":"Tag","objec

      tName":"TestAPI","data":null}],"id":null}

       

      Result :

      {"id":"6b5f0fbd-7415-4349-b07c-d02f0fef8833","createdDate":"1753-01-01T00:00:00.000Z","modifiedDate":"1753-01-01T00:00:00.000Z","modifiedByUserName":"INTERNAL\\

      sa_repository","items":[{"id":"29783b81-bcd6-436b-a1b8-90eb683b739a","createdDate":"1753-01-01T00:00:00.000Z","modifiedDate":"1753-01-01T00:00:00.000Z","modifiedByUserName":"INTERNAL\\sa_repository","type":"Tag","objectID":"789a093d-b32c-4c5e-87d9-332a2ed835a0","objectName":"","schemaPath":"Selection.Item"}],"privilege

      s":null,"schemaPath":"Selection"}

       

       

      2) Send update

       

      https://FNTVAQSEDEV0847.france.rexel:4242/qrs/selection/6b5f0fbd-7415-4349-b07c-d02f0fef8833/app/synthetic?Xrfkey=0123456789abcdef&filter=id eq 789a093d-b32c-4c5e-87d9-332a2ed835a0

       

      {

           "properties": [

                {

                     "name": "name",

                     "value": "d422f442-7a57-4613-86d2-64a6b31e40b7",

                     "valueIsModified":true,

                     "schemaPath": "SyntheticProperty"

                }

           ],

           "type":"tag"

      }

       

      Response : blank line => should be ok

       

      Result : Unfortunatly, nothing changed, and I can't find effective way to update object property.

       

      Thanks by advance for any help.

       

      Ghislain Ferréol