cancel
Showing results for 
Search instead for 
Did you mean: 
iburiak
Sisense Team Member
Sisense Team Member

You will learn about common scenarios where we may need to copy or apply a new list of sharings for dashboards within this article. 

  • We need to export some dashboard corruption, remove them from the instance, and import them back. 
  • Copy the share list from one dashboard to another.
  • Add new users to dashboard sharing through the RestAPI.
  • Any other everyday use case.

Providing clear instructions and guidelines in the article will provide users with an understanding of the process and enable them to effectively request the necessary access changes.

To save and apply shares to dashboards in Sisense using REST API calls, you can follow these simple steps:

1. Retrieve the dashboard ID: You'll need the dashboard ID to apply shares. You can obtain the ID by either navigating to the dashboard in the Sisense web application and extracting it from the URL, or using the Sisense API to retrieve the dashboard list.

 

iburiak_0-1687467668475.png

 

2. Retrieve the existing shares: Go to Admin -> REST API -> V1.0 -> GET/dashboards​/{dashboardId}​/shares. Put the dashboard OID into the dashboardId field and press execute.

 

iburiak_1-1687467667583.png

 

3. Copy the share list from the response body. 

 

iburiak_2-1687467667934.png

 

4. Define the shares: If necessary, you may alter the share definitions for the dashboard and modify them to different shares or keep them as they are without any modifications. Each share consists of a user or group ID and the access level (e.g., "View" or "Edit").

[

  {

    "shareId": "6493ae6f6df645001beab110",

    "type": "user",

    "subscribe": false

  },

  {

    "shareId": "6494a27d4e1d78002df41f9a",

    "type": "user",

    "rule": "view",

    "subscribe": false

  },

  {

    "shareId": "6494a27d4e1d78002df41f96",

    "type": "user",

    "rule": "edit",

    "subscribe": false

  },

  {

    "shareId": "6494a43a4e1d78002df41fa2",

    "type": "group",

    "rule": "view",

    "subscribe": false

  }

]

5. Save the shares: Use the PATCH​/dashboards​/{id} endpoint to save the shares. You can use the same OID if you removed the dashboard and imported it back or take another OID to copy the share list to another dashboard.  You can either replace all existing shares with new ones or add new shares while keeping the existing ones intact.

Request body example. 

{

  "shares": [

  {

    "shareId": "6493ae6f6df645001beab110",

    "type": "user",

    "subscribe": false

  }

  ]

}

 

iburiak_3-1687467667710.png

 

Ensure the response body is 200 and shares are applied correctly.

 

iburiak_4-1687467668203.png

 

6. Test and verify: After making the API call to save the shares, open the dashboard where the shares were applied and republish it. Check if the changes are reflected in the Sisense web application. Ensure that the users or groups specified in the shares have the intended access to the dashboard. 

 

iburiak_5-1687467668171.png

Note: Ensure you have the necessary permissions and access rights to perform these actions in Sisense. Also, refer to the Sisense API documentation for the list of available endpoints, request/response formats, and authentication methods.

Remember to handle errors gracefully and secure your API keys to prevent unauthorized access to your Sisense instance.

Rate this article:
Version history
Last update:
‎06-22-2023 02:58 PM
Updated by: