Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
sanket8397
Contributor II
Contributor II

Change ownership of Qlik Sense object using QRS API

Hi,

How to change owner of sheet/story using QRS API ?

Thank you.

Labels (4)
1 Solution

Accepted Solutions
Levi_Turner
Employee
Employee

At a high level the flow would be:

  • GET /qrs/app/object/{id}
  • Adjust the owner.id to a new user's GUID. Optional: adjust the userId, userDirectory, and name attributes in the owner element. 
  • PUT /qrs/app/object/{id}

 

Example:

GET /qrs/app/object/5d05292b-f5dc-4cf7-9aea-0a05f51a602d

{
  "id": "5d05292b-f5dc-4cf7-9aea-0a05f51a602d",
  "createdDate": "2019-01-29T13:14:26.066Z",
  "modifiedDate": "2019-02-15T15:46:20.997Z",
  "modifiedByUserName": "domain\\levi",
  "owner": {
    "id": "5334b296-493b-46ee-b621-79ba238ceb2c",
    "userId": "sa_repository",
    "userDirectory": "INTERNAL",
    "name": "sa_repository",
    "privileges": null
  },
  "engineObjectType": "",
  "description": "",
  "attributes": "eyJUeXBlIjoiR2VuZXJpY0FwcE9iamVjdEVudHJ5IiwiRm9ybWF0IjoiZ3pqc29uIiwiVGl0bGUiOiIiLCJQYXJlbnRJZCI6ImJhMTE4NTE4LWU5YzUtNDFmYS1iZWEyLWIwNjY1MjQxNmJmMyIsIklzVGVtcG9yYXJ5IjpmYWxzZSwiQ29udGVudEhhc2giOiJpYmRjQm9nSkJ1aFV1d3NaMU1lamx1MlRhZTVubUNwZlRLbjUyaWxUUlNnPSJ9",
  "objectType": "story",
  "publishTime": "1753-01-01T00:00:00Z",
  "published": false,
  "approved": false,
  "tags": [],
  "sourceObject": "",
  "draftObject": "",
  "name": "My new story",
  "app": {
    "id": "12f964b0-fc25-4de6-9803-30749b21d192",
    "name": "Case MGMT (US)",
    "appId": "",
    "publishTime": "2018-04-20T22:22:39.021Z",
    "published": true,
    "stream": {
      "id": "aaec8d41-5201-43ab-809f-3063750dfafd",
      "name": "Everyone",
      "privileges": null
    },
    "savedInProductVersion": "12.421.3",
    "migrationHash": "21ecc792c56e18162f1785d3d41f28fdaced5c96",
    "availabilityStatus": 0,
    "privileges": null
  },
  "appObjectBlobId": "",
  "engineObjectId": "ba118518-e9c5-41fa-bea2-b06652416bf3",
  "contentHash": "JYN=:!C*9![5N\\#:1^RD;F\\4GG\\HBJ+@=5KZL>+46%+",
  "size": -1,
  "privileges": null,
  "schemaPath": "App.Object"
}

PUT /qrs/app/object/5d05292b-f5dc-4cf7-9aea-0a05f51a602d

{
  "id": "5d05292b-f5dc-4cf7-9aea-0a05f51a602d",
  "createdDate": "2019-01-29T13:14:26.066Z",
  "modifiedDate": "2019-02-15T15:46:20.997Z",
  "modifiedByUserName": "domain\\levi",
  "owner": {
    "id": "4b7a27e5-f1db-4cc2-be59-7c4086f7c1f6"
  },
  "engineObjectType": "",
  "description": "",
  "attributes": "eyJUeXBlIjoiR2VuZXJpY0FwcE9iamVjdEVudHJ5IiwiRm9ybWF0IjoiZ3pqc29uIiwiVGl0bGUiOiIiLCJQYXJlbnRJZCI6ImJhMTE4NTE4LWU5YzUtNDFmYS1iZWEyLWIwNjY1MjQxNmJmMyIsIklzVGVtcG9yYXJ5IjpmYWxzZSwiQ29udGVudEhhc2giOiJpYmRjQm9nSkJ1aFV1d3NaMU1lamx1MlRhZTVubUNwZlRLbjUyaWxUUlNnPSJ9",
  "objectType": "story",
  "publishTime": "1753-01-01T00:00:00Z",
  "published": false,
  "approved": false,
  "tags": [],
  "sourceObject": "",
  "draftObject": "",
  "name": "My new story",
  "app": {
    "id": "12f964b0-fc25-4de6-9803-30749b21d192",
    "name": "Case MGMT (US)",
    "appId": "",
    "publishTime": "2018-04-20T22:22:39.021Z",
    "published": true,
    "stream": {
      "id": "aaec8d41-5201-43ab-809f-3063750dfafd",
      "name": "Everyone",
      "privileges": null
    },
    "savedInProductVersion": "12.421.3",
    "migrationHash": "21ecc792c56e18162f1785d3d41f28fdaced5c96",
    "availabilityStatus": 0,
    "privileges": null
  },
  "appObjectBlobId": "",
  "engineObjectId": "ba118518-e9c5-41fa-bea2-b06652416bf3",
  "contentHash": "JYN=:!C*9![5N\\#:1^RD;F\\4GG\\HBJ+@=5KZL>+46%+",
  "size": -1,
  "privileges": null,
  "schemaPath": "App.Object"
}

View solution in original post

2 Replies
Levi_Turner
Employee
Employee

At a high level the flow would be:

  • GET /qrs/app/object/{id}
  • Adjust the owner.id to a new user's GUID. Optional: adjust the userId, userDirectory, and name attributes in the owner element. 
  • PUT /qrs/app/object/{id}

 

Example:

GET /qrs/app/object/5d05292b-f5dc-4cf7-9aea-0a05f51a602d

{
  "id": "5d05292b-f5dc-4cf7-9aea-0a05f51a602d",
  "createdDate": "2019-01-29T13:14:26.066Z",
  "modifiedDate": "2019-02-15T15:46:20.997Z",
  "modifiedByUserName": "domain\\levi",
  "owner": {
    "id": "5334b296-493b-46ee-b621-79ba238ceb2c",
    "userId": "sa_repository",
    "userDirectory": "INTERNAL",
    "name": "sa_repository",
    "privileges": null
  },
  "engineObjectType": "",
  "description": "",
  "attributes": "eyJUeXBlIjoiR2VuZXJpY0FwcE9iamVjdEVudHJ5IiwiRm9ybWF0IjoiZ3pqc29uIiwiVGl0bGUiOiIiLCJQYXJlbnRJZCI6ImJhMTE4NTE4LWU5YzUtNDFmYS1iZWEyLWIwNjY1MjQxNmJmMyIsIklzVGVtcG9yYXJ5IjpmYWxzZSwiQ29udGVudEhhc2giOiJpYmRjQm9nSkJ1aFV1d3NaMU1lamx1MlRhZTVubUNwZlRLbjUyaWxUUlNnPSJ9",
  "objectType": "story",
  "publishTime": "1753-01-01T00:00:00Z",
  "published": false,
  "approved": false,
  "tags": [],
  "sourceObject": "",
  "draftObject": "",
  "name": "My new story",
  "app": {
    "id": "12f964b0-fc25-4de6-9803-30749b21d192",
    "name": "Case MGMT (US)",
    "appId": "",
    "publishTime": "2018-04-20T22:22:39.021Z",
    "published": true,
    "stream": {
      "id": "aaec8d41-5201-43ab-809f-3063750dfafd",
      "name": "Everyone",
      "privileges": null
    },
    "savedInProductVersion": "12.421.3",
    "migrationHash": "21ecc792c56e18162f1785d3d41f28fdaced5c96",
    "availabilityStatus": 0,
    "privileges": null
  },
  "appObjectBlobId": "",
  "engineObjectId": "ba118518-e9c5-41fa-bea2-b06652416bf3",
  "contentHash": "JYN=:!C*9![5N\\#:1^RD;F\\4GG\\HBJ+@=5KZL>+46%+",
  "size": -1,
  "privileges": null,
  "schemaPath": "App.Object"
}

PUT /qrs/app/object/5d05292b-f5dc-4cf7-9aea-0a05f51a602d

{
  "id": "5d05292b-f5dc-4cf7-9aea-0a05f51a602d",
  "createdDate": "2019-01-29T13:14:26.066Z",
  "modifiedDate": "2019-02-15T15:46:20.997Z",
  "modifiedByUserName": "domain\\levi",
  "owner": {
    "id": "4b7a27e5-f1db-4cc2-be59-7c4086f7c1f6"
  },
  "engineObjectType": "",
  "description": "",
  "attributes": "eyJUeXBlIjoiR2VuZXJpY0FwcE9iamVjdEVudHJ5IiwiRm9ybWF0IjoiZ3pqc29uIiwiVGl0bGUiOiIiLCJQYXJlbnRJZCI6ImJhMTE4NTE4LWU5YzUtNDFmYS1iZWEyLWIwNjY1MjQxNmJmMyIsIklzVGVtcG9yYXJ5IjpmYWxzZSwiQ29udGVudEhhc2giOiJpYmRjQm9nSkJ1aFV1d3NaMU1lamx1MlRhZTVubUNwZlRLbjUyaWxUUlNnPSJ9",
  "objectType": "story",
  "publishTime": "1753-01-01T00:00:00Z",
  "published": false,
  "approved": false,
  "tags": [],
  "sourceObject": "",
  "draftObject": "",
  "name": "My new story",
  "app": {
    "id": "12f964b0-fc25-4de6-9803-30749b21d192",
    "name": "Case MGMT (US)",
    "appId": "",
    "publishTime": "2018-04-20T22:22:39.021Z",
    "published": true,
    "stream": {
      "id": "aaec8d41-5201-43ab-809f-3063750dfafd",
      "name": "Everyone",
      "privileges": null
    },
    "savedInProductVersion": "12.421.3",
    "migrationHash": "21ecc792c56e18162f1785d3d41f28fdaced5c96",
    "availabilityStatus": 0,
    "privileges": null
  },
  "appObjectBlobId": "",
  "engineObjectId": "ba118518-e9c5-41fa-bea2-b06652416bf3",
  "contentHash": "JYN=:!C*9![5N\\#:1^RD;F\\4GG\\HBJ+@=5KZL>+46%+",
  "size": -1,
  "privileges": null,
  "schemaPath": "App.Object"
}
sanket8397
Contributor II
Contributor II
Author

@Levi_Turner  ,  Thank you for solution. It worked like a charm.

When I tried changing sheet name with same method by changing "name" in JSON, changes were successfully reflected in QMC. But on hub in original application , I am seeing old sheet name only.

Can you please suggest.