2 Replies Latest reply: Aug 28, 2018 3:23 AM by Goran Korsgren RSS

    Is it not possible to set owner of an object via api?

    Goran Korsgren

      Hi

       

      I would like to create a DataConnection and set owner of it via api.

       

      I use /qrs/dataconnection/ and creating the DataConnection works fine, but I have no success setting the owner to a specific user,

      is that not possible?

        • Re: Is it not possible to set owner of an object via api?
          Levi Turner

          Hey Goran.

           

          Sure. Anything you do in the QMC can be done via QRS API. The endpoints are in this vein:

          GET /qrs/dataconnection/6cf48bd8-3b28-461d-8578-e92a9a0aa21a

          {
            "id": "6cf48bd8-3b28-461d-8578-e92a9a0aa21a",
            "createdDate": "2017-05-08T18:20:45.118Z",
            "modifiedDate": "2018-08-27T13:47:24.434Z",
            "modifiedByUserName": "QTSEL\\ltu",
            "customProperties": [],
            "owner": {
              "id": "5334b296-493b-46ee-b621-79ba238ceb2c",
              "userId": "sa_repository",
              "userDirectory": "INTERNAL",
              "name": "sa_repository",
              "privileges": null
            },
            "name": "data",
            "connectionstring": "C:\\Data\\",
            "type": "folder",
            "engineObjectId": "6cf48bd8-3b28-461d-8578-e92a9a0aa21a",
            "username": "",
            "password": "",
            "logOn": 0,
            "architecture": 0,
            "tags": [],
            "privileges": null,
            "schemaPath": "DataConnection"
          }
          

          PUT /qrs/dataconnection/6cf48bd8-3b28-461d-8578-e92a9a0aa21a

          Body:

          {
            "id": "6cf48bd8-3b28-461d-8578-e92a9a0aa21a",
            "createdDate": "2017-05-08T18:20:45.118Z",
            "modifiedDate": "2018-08-27T13:47:24.434Z",
            "modifiedByUserName": "QTSEL\\ltu",
            "customProperties": [],
            "owner": {
              "id": "0d11d863-1c53-4a00-8699-3837b09109aa",
              "userId": "ltu",
              "userDirectory": "QTSEL",
              "name": "Levi Turner",
              "privileges": null
            },
            "name": "data",
            "connectionstring": "C:\\Data\\",
            "type": "folder",
            "engineObjectId": "6cf48bd8-3b28-461d-8578-e92a9a0aa21a",
            "username": "",
            "password": "",
            "logOn": 0,
            "architecture": 0,
            "tags": [],
            "privileges": null,
            "schemaPath": "DataConnection"
          }
          

          So basically you are altering the owner elements of the JSON to point to another user.

           

          Hope that helps.