»»» Sisense Verison 7.1 and below: UPDATED 6/10/2016 «««
»»» Sisense Verison 7.2 and above: UPDATED 2/22/2019 «««
Introduction
This Python script will demonstrate using the REST API for sharing dashboards and folders. There are two versions of this script, one is for Sisense version 7.1 and below. The newer script is for Sisense version 7.2 and above.
The script includes the following examples:
- Share a dashboard with a single user
- Share a dashboard with a group
- Share a folder with a single user
- Share a folder with a group
- Get the folder ID by the folder name
- Get a list of IDs of the dashboards in a folder
Pre-Req.
- REST API Key token (see here on how to obtain your token Sisense REST API)
- Python installed on your system.
- If setting up on Sisense 7.1 and below - install Python 2.7 on your system
- If setting up on Sisense 7.2 and above - install Python 3.7 on your system
- Admin permissions
- Download the appropriate script based on the Sisense version you are running:
- If setting up on Sisense 7.1 and below - updatesSharesAPI-7-1-below.zip
- If setting up on Sisense 7.2 and above - updateSharesAPI-7-2-above.zip
Configuration
To configure the script run on your system You will need to modify the following settings in the script.
LOG_LEVEL |
Available options
|
LOG_FILE_NAME | Log file path |
REST_API_TOKEN | Token string |
Admin email address | |
PASSWORD | Admin password |
Running the Script
First, edit the script's main() function and uncomment the calls you want to use.
The available calls are:
share_dashboard_with_user(<user name>, <dashboard id>) |
Share a dashboard with a single user. |
share_dashboard_with_group(<group name>, <dashboard id>) | Share a dashboard with a group. |
share_folder_with_user(<user name>, <folder name>) | Share a folder with a single user. |
share_folder_with_group(<group name>, <folder name>) | Share a folder with a group. |
get_folder_id(<folder name>) | Get the folder ID by the folder name. |
get_dashboards_in_folder(<folder name>) | Get a list of IDs of the dashboards in a folder. |
Then, from a command line window run the following command:
C:\>python <path to script>\updatesSharesAPI.py
The Script
Python scripts attached below.
On Sisense 7.1 and below: updatesSharesAPI-7-1-below.zip
On Sisense 7.2 and above: updateSharesAPI-7-2-above.zip