<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Changing Appowner trough REST API in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/Changing-Appowner-trough-REST-API/m-p/1511030#M9550</link>
    <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;We are trying to set up a change-owner script that allows us to import apps including meta data. The scenario is as follows: User imports an app, if there's metadata available (includes stream data and owner data), it checks wether the owner in the metadata exists in the current Qlik Environment. If so: It should change the owner.&lt;/P&gt;&lt;P&gt;Now I'm using this endpoint:&lt;/P&gt;&lt;P&gt;await _qrsClient.Put("/qrs/Selection/" + appID + "/App/synthetic?xrfkey=ABCDEFG123456789", content.ToString());&lt;/P&gt;&lt;P&gt;- appID = the id of the App to be changed.&lt;/P&gt;&lt;P&gt;- content (body)=&lt;/P&gt;&lt;P&gt;&amp;nbsp;{[&lt;BR /&gt;{&lt;BR /&gt;"LatestModifiedDate": "2018-11-22T12:00:58.097Z",&lt;BR /&gt;"properties": {&lt;BR /&gt;"name": "owner",&lt;BR /&gt;"value": "a9d40139-cd13-467a-9147-ab167c51685a",&lt;BR /&gt;"valueIsModified": true&lt;BR /&gt;},&lt;BR /&gt;"type": "App"&lt;BR /&gt;}&lt;BR /&gt;]}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I get the following error:&lt;/P&gt;&lt;P&gt;The remote server returned an error: (400) Bad Request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone point us in the right direction here?&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 21:50:35 GMT</pubDate>
    <dc:creator>joshuapierlo</dc:creator>
    <dc:date>2024-11-16T21:50:35Z</dc:date>
    <item>
      <title>Changing Appowner trough REST API</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Changing-Appowner-trough-REST-API/m-p/1511030#M9550</link>
      <description>&lt;P&gt;Hello everyone,&lt;/P&gt;&lt;P&gt;We are trying to set up a change-owner script that allows us to import apps including meta data. The scenario is as follows: User imports an app, if there's metadata available (includes stream data and owner data), it checks wether the owner in the metadata exists in the current Qlik Environment. If so: It should change the owner.&lt;/P&gt;&lt;P&gt;Now I'm using this endpoint:&lt;/P&gt;&lt;P&gt;await _qrsClient.Put("/qrs/Selection/" + appID + "/App/synthetic?xrfkey=ABCDEFG123456789", content.ToString());&lt;/P&gt;&lt;P&gt;- appID = the id of the App to be changed.&lt;/P&gt;&lt;P&gt;- content (body)=&lt;/P&gt;&lt;P&gt;&amp;nbsp;{[&lt;BR /&gt;{&lt;BR /&gt;"LatestModifiedDate": "2018-11-22T12:00:58.097Z",&lt;BR /&gt;"properties": {&lt;BR /&gt;"name": "owner",&lt;BR /&gt;"value": "a9d40139-cd13-467a-9147-ab167c51685a",&lt;BR /&gt;"valueIsModified": true&lt;BR /&gt;},&lt;BR /&gt;"type": "App"&lt;BR /&gt;}&lt;BR /&gt;]}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, I get the following error:&lt;/P&gt;&lt;P&gt;The remote server returned an error: (400) Bad Request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could anyone point us in the right direction here?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 21:50:35 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Changing-Appowner-trough-REST-API/m-p/1511030#M9550</guid>
      <dc:creator>joshuapierlo</dc:creator>
      <dc:date>2024-11-16T21:50:35Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Appowner trough REST API</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Changing-Appowner-trough-REST-API/m-p/1511704#M9551</link>
      <description>&lt;P&gt;Sure&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/47808"&gt;@joshuapierlo&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;I'm going to abstract away from your particular code and point to the generic approach.&lt;/P&gt;&lt;P&gt;Get the details of the app we want to change: &lt;FONT face="courier new,courier"&gt;GET /qrs/app/055e0e8d-0f10-4d22-a175-62b05143347a&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Response:&lt;/P&gt;&lt;PRE&gt;{
  "id": "055e0e8d-0f10-4d22-a175-62b05143347a",
  "createdDate": "2018-11-23T17:48:27.321Z",
  "modifiedDate": "2018-11-23T17:49:26.141Z",
  "modifiedByUserName": "QTSEL\\ltu",
  "customProperties": [],
  "owner": {
    "id": "5334b296-493b-46ee-b621-79ba238ceb2c",
    "userId": "sa_repository",
    "userDirectory": "INTERNAL",
    "name": "sa_repository",
    "privileges": null
  },
  "name": "AppOwnerChangeDemo",
  "appId": "",
  "sourceAppId": "00000000-0000-0000-0000-000000000000",
  "targetAppId": "00000000-0000-0000-0000-000000000000",
  "publishTime": "1753-01-01T00:00:00Z",
  "published": false,
  "tags": [],
  "description": "",
  "stream": null,
  "fileSize": 145970,
  "lastReloadTime": "2018-07-24T13:14:06.545Z",
  "thumbnail": "",
  "savedInProductVersion": "12.108.7",
  "migrationHash": "98d482c3f964dccf69cbfb9a00e0c048ea6eb221",
  "dynamicColor": "",
  "availabilityStatus": 0,
  "privileges": null,
  "schemaPath": "App"
}&lt;/PRE&gt;&lt;P&gt;With this, we can see that the owner information is stored as an array inside the response.&lt;/P&gt;&lt;P&gt;Getting different user details (&lt;FONT face="courier new,courier"&gt;GET /qrs/user/full?filter=(name eq 'sa_api')&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;  {
    "id": "4b7a27e5-f1db-4cc2-be59-7c4086f7c1f6",
    "createdDate": "2017-05-06T00:54:59.921Z",
    "modifiedDate": "2017-05-06T00:54:59.921Z",
    "modifiedByUserName": "INTERNAL\\bootstrap",
    "customProperties": [],
    "userId": "sa_api",
    "userDirectory": "INTERNAL",
    "name": "sa_api",
    "roles": [],
    "attributes": [],
    "inactive": false,
    "removedExternally": false,
    "blacklisted": false,
    "deleteProhibited": false,
    "tags": [],
    "privileges": null,
    "schemaPath": "User"
  }&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;Now changing the owner of the original app: &lt;FONT face="courier new,courier"&gt;PUT /qrs/app/055e0e8d-0f10-4d22-a175-62b05143347a&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;Body:&lt;/P&gt;&lt;PRE&gt;{
  "id": "055e0e8d-0f10-4d22-a175-62b05143347a",
  "createdDate": "2018-11-23T17:48:27.321Z",
  "modifiedDate": "2018-11-23T17:49:26.141Z",
  "modifiedByUserName": "QTSEL\\ltu",
  "customProperties": [],
  "owner": {
    "id": "4b7a27e5-f1db-4cc2-be59-7c4086f7c1f6",
    "userId": "sa_api",
    "userDirectory": "INTERNAL",
    "name": "sa_api",
    "privileges": null
  },
  "name": "AppOwnerChangeDemo",
  "appId": "",
  "sourceAppId": "00000000-0000-0000-0000-000000000000",
  "targetAppId": "00000000-0000-0000-0000-000000000000",
  "publishTime": "1753-01-01T00:00:00Z",
  "published": false,
  "tags": [],
  "description": "",
  "stream": null,
  "fileSize": 145970,
  "lastReloadTime": "2018-07-24T13:14:06.545Z",
  "thumbnail": "",
  "savedInProductVersion": "12.108.7",
  "migrationHash": "98d482c3f964dccf69cbfb9a00e0c048ea6eb221",
  "dynamicColor": "",
  "availabilityStatus": 0,
  "privileges": null,
  "schemaPath": "App"
}&lt;/PRE&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Nov 2018 17:55:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Changing-Appowner-trough-REST-API/m-p/1511704#M9551</guid>
      <dc:creator>Levi_Turner</dc:creator>
      <dc:date>2018-11-23T17:55:17Z</dc:date>
    </item>
    <item>
      <title>Re: Changing Appowner trough REST API</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/Changing-Appowner-trough-REST-API/m-p/1512956#M9563</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.qlik.com/t5/user/viewprofilepage/user-id/47469"&gt;@Levi_Turner&lt;/a&gt;&amp;nbsp;!&lt;BR /&gt;&lt;BR /&gt;Thank you kindly for your response. I was out of the office for a few days...&amp;nbsp;&lt;/P&gt;&lt;P&gt;My way of thinking was quite silly! Why would I create a new content object if I can just rip it from another app with the same owner.... Your method works perfectly fine!&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a bunch &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 27 Nov 2018 14:26:48 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/Changing-Appowner-trough-REST-API/m-p/1512956#M9563</guid>
      <dc:creator>joshuapierlo</dc:creator>
      <dc:date>2018-11-27T14:26:48Z</dc:date>
    </item>
  </channel>
</rss>

