Retrieving or searching dashboards of a particular user
My particular requirement is to transfer ownership of all dashboards belong to user A to user B before user A gets deleted using REST API
There appears to be no straightforward way to do this. So I have to at least get all dashboards of user A and transfer ownership each one individually to user B using REST API
1. I can't get dashboard of a user by passing in a specific userID
2. there is GET /dashboards/admin , POST /dashboards/admin and POST /dashboard/searches but it it is not clear how to query dashboards of just one user ?
It is not feasible on a large system to first get all dashboards and sift through that to get only the dashboards of the user I am interested in.
Is it possible to query for dashboards of a specific user ?
Thanks
-
Hi Arun,
You're in the right direction with that /admin endpoint.
You can use it to get the primary instances of all dashboards owned by a specific user by their username/email: For example:
/api/v1/dashboards/admin?dashboardType=owner&ownerInfo=true&ownershipType=allRoot&search=owner%3A%20test%40sisense.com&asObject=false
A breakdown of the query parameters used:- "
ownershipType=allRoot"
means search all dashboards in the system, even those I (the current logged in user/owner of the token) have no access to - "
dashboardType=owner"
means only get the "owner instance" of each dashboard (we don't need the viewer clones) - "
ownerInfo=true"
isn't really required but it makes the response objects contain full owner info including an email so i can easily validate the results and filter out any incorrect ones, without having to do another call to/users
-
"search=owner%3A%20test%
40sisense.com"
which unencoded is "owner:
test@sisense.com".
this is a free-text search that supports this specific search by username
Hope this helps you get it done!
- "
-
Yes, thanks Moti Granovsky . That is exactly what I am looking for.
Please sign in to leave a comment.
Comments
3 comments