Manage Color Palettes
Introduction This step-by-step article explains how to change the color palette so that you can use custom colors for elements of the Sisense dashboards. (This will work in V5.7.5 and higher). How to get your existing palettes 1. Go to v0.9 GET / palettes and hit “RUN” How to create a new schema 1. Go to POST / palettes and insert the required schema into the “Value” input box and hit “RUN”. 2. Use the following syntax and update the “colors” and “name” parameters according to your needs. You can add up to 16 colors in a custom palette. In addition, you can modify the following parameters: 'isDefault' = true means that new dashboards will be created with this palette by default. There can only be one default palette at any time. 'sortOrder' - determines the order of the palette in the palettes list displayed in the dashboard drop-down { "colors": [ "#ff0000", "#001c5a", "#cfeb00", "#2dff00", "#00a79b", "#218A8C" ], "name": "MyPalette", "isDefault": true, "sortOrder": 10 } 3. The new palette will be added to your Dashboard Palettes. How to delete a palette: 1. Go to Delete / palettes / {name} and insert the required schema into the “Value” input box 2. Insert the name of the Palette you wish to delete into the Value input box and hit “RUN” 3. The Palette will be deleted from the Dashboard Palettes2.8KViews4likes0CommentsGet Widget’s Values Directly From The ElastiCube (API Request)
Description Shifting between external sources that are based on different scripting languages is not an easy task. When there is a requirement to query a secured widget's data to an external source (Such as JQuery, JavaScript,HTTP etc.), you will need to utilize the REST API. A quick example will be grabbing a widget's data to a public website or a customized company's mail report. Prerequisites Sisense Admin permission REST API Access ElastiCube and linked dashboard with widgets PostMan application installed - https://www.getpostman.com/apps Granted access to the machine (IP) that is going to execute the API request against the Sisense Server - Check that the dashboard is accessible from the external machine that execute the API request. Steps a. Widget's JAQL Preparation and Save it Make the the JAQL code as short as possible by "starring" the formulas that are used in the widget - https://docs.sisense.com/main/SisenseLinux/reusing-formulas.htm To get the widget's JAQL code - Edit Widget > Click on F12 to open developer tools > Open Console > Clear Content > type - prism.debugging.GetJaql(prism.activeWidget).replace(/(\r\n|\n|\r|\t)/gm, ""); and then hit enter 3. Copy the JAQL code to notepad - without the quotes b. Create the Curl and URL Request 1. Go to the Admin Page > Click on REST API reference > Open REST API 0.9 (top right of the screen) 2. Go to - Post> elasticubes/{elasticube}/jaql 3. Copy the JAQL code into the request's body 4. Copy the ElastiCube ID from the JAQL code (data source section) into the ElastiCube input without the quotes. For example: 5. Hit Run and validate the response. A correct response will appear in bottom: 6. Copy the Curl and Request URL to notepad: c. Create authentication token to query the ElastiCube 1. Go to the Admin Page > Click on REST API reference > Open REST API 1.0 (top right of the screen) 2. Go to - Post> authentication/login 3. Insert your username/password and hit execute 4. Copy the given access token from the response section without quotes to notepad d. Generate the Final API Request 1. Open PostMan and create a new POST request 2. Enter the Request URL - Place Sisense Request URL and ElastiCube ID taken from the step B. 3. Copy the the body tab (choose raw option) the entire JAQL code from step A. 4. Open Authorization tab > choose Bearer type > Insert your authentication token from Step C. 5. Open Headers section and add: Content-Type, application/json Accept, application/json 6. Hit send to get the API call response that will include your widget data values Response Example: 7. Click on "code" (right side of the page), to covert the API request to any scripting language that is required.2.2KViews0likes2CommentsUsing the Datasources API to Execute SQL Query and Download Data into a Python Dataframe
This article guides how to use the Datasources API to execute an SQL query and download data from a cube into a Python data frame. The issue arises when a user cannot find the API in the REST API tab and encounters difficulties in downloading the data into a Python data frame.2.2KViews1like0CommentsAccess Sisense API From Postman
Introduction: In order to invoke the Sisense API from Postman or from an external application you first need access to an API token. In order to do this you need to make a POST request with the username and password submitted as a URL encoded form submission. Set the following headers: Content-Type - application/x-www-form-urlencoded Accept - application/json Enter the username and password with the following format username=<url encoded user>&password=<url encoded password> e.g. username=jay.dastur%40sisense.com&password=xxxx See Screenshots: Once you have the API token, you can make subsequent calls to the API by passing on the token as the Authorization header in the following format - Bearer <api token>2KViews0likes0CommentsBeginner Sisense REST API Tips
Three tips for new users working with Sisense's REST API for the first time. 1. If you're running API calls through our Swagger UI (ie, by going to Admin -> REST API -> REST API Reference), you do not need to generate and pass an authentication token. You only need the token when running a call from an outside application. 2. If you receive a 500 response code with an error message of "Internal Server Error" to your POST/PATCH call, that typically indicates there is a syntax error in the payload. To confirm and troubleshoot this, use an online JSON validator (such as JSONLint - https://jsonlint.com/) to review your syntax and identify errors. 3. If you're incorporating our REST API within a program, one tip to accelerate the development process is to use a third-party API tool such as Postman. You can copy the cURL our Swagger UI outputs and paste it in Postman (Import -> Paste Raw Text) to build your API call - just add the Authentication header before running. Once you've verified your call is set up correctly, click Code, then select your language from the dropdown. This will automatically give you a script for the API call in your language.1.9KViews1like1CommentREST API - Adding Data Level Security
When building code to automate the process of adding users (or groups), it may be beneficial to add security around those users. Follow the steps below to learn how to add data level security through the REST API: Step 1 From your SiSense home page, navigate to the Manage tab and choose the option for REST API. From here, click on the link to the REST API Reference interface. Step 2 From here, choose the 0.9 version and expand the Elasticube section and scroll down to the POST /elasticubes/datasecurity section. Step 3 The sample code below shows a valid JSON object to use as part of the REST API request. Starting from the sample code, replace the value for party with a user identifier that already exists in your system. Then paste the code into the REST API interface and click run. You should see a response of 200, which indicates a successful operation. [{ "server": "LocalHost", "elasticube": "Sample Lead Generation", "table": "Lead Generation", "column": "Country", "datatype": "text", "shares": [{ "party": "5c0f85690ca2f66cc242e266", "type": "user" }], "members": [ "United States", "England" ] }] Notes The server name value is case sensitive, so make sure it matches with your system. The sample provided is specific to one of the sample databases that comes with SiSense. To modify this to a different system, just update necessary fields to include your specifications. The sample provided is an array that consists of a single element. This could be modified to contain several entries all sent at once.1.8KViews1like2CommentsAdd Multiple Users from a CSV file and an API
In some cases, you would like to add many users in bulk. The users are often managed in a CSV file. With the following steps, you will be able to insert users from a CSV file by converting the CSV file to a JSON format and run it with an API through the Swagger. Steps: 1. Prepare a CSV file with the following columns (case sensitive): email userName firstName lastName roleId groups/0 [email protected] Test10 FName10 Lname10 5d072c7b94278724f71ba2e5 5f477932c87fea1354e3e781 [email protected] Test11 FName11 Lname11 5d072c7b94278724f71ba2e5 5f477932c87fea1354e3e781 [email protected] Test12 FName12 Lname12 5d072c7b94278724f71ba2e5 5f477932c87fea1354e3e781 email - User's email userName - User's user name firstName - User First Name lastName - User Last Name roleId - The role you would like to assign the user. The roles are - admin, contributor, consumer and dataDesigner You need to apply the roleId for each type of role. Note that each Sisense installation has a different roleId for similar role names. You can get the roleId for each role name by running the GET command in the Role group in Swagger 0.9. groups/0 - The group id you want the user to be part of Note: The groups have to exist. Use the Swagger 0.9 -> Groups -> Get -> Groups to get each group’s id. 2. Use a utility to transform the CSV file into a JSON format for example http://convertcsv.com/csv-to-json.htm) [ { "email": "[email protected]", "userName": "Test10", "firstName": "FName10", "lastName": "Lname10", "roleId": "5d072c7b94278724f71ba2e5", "groups": [ "5f477932c87fea1354e3e781" ] }, { "email": "[email protected]", "userName": "Test11", "firstName": "FName11", "lastName": "Lname11", "roleId": "5d072c7b94278724f71ba2e5", "groups": [ "5f477932c87fea1354e3e781" ] }, { "email": "[email protected]", "userName": "Test12", "firstName": "FName12", "lastName": "Lname12", "roleId": "5d072c7b94278724f71ba2e5", "groups": [ "5f477932c87fea1354e3e781" ] } ] Note: After adding the new users, an activation email will be sent to each. The users then would need to set the initial password. If you wish to set an initial password and for the user only to get a Welcome message, then add a password column. In the JSON you will see another line looking like this: "password":"Sisense!1234" 3. Copy the JSON expression and paste it in Swagger 1.0 -> Users-> Post-> /users/bulk and execute. If you get response code 201...you made it 🙂 4. Check the users and groups in Admin - > Users Enjoy and share 🙂 Tamir1.5KViews0likes0CommentsRetrieving Or Searching Dashboards Of A Particular User
Question: Is it possible to query for dashboards of a specific user? Answer: the right direction is with the /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: [email protected]". this is a free-text search that supports this specific search by username1.2KViews1like0CommentsMoving Your Data Security From A Cube To A Set
In some cases you would like to move a cube that has data security on it to a set, doing that will require recreating all of the data security from scratch. Easy solution is to take the data security from the old cube and modify it that it will work with the set 1. Open your Admin page > Rest API > v0.9 2. Run the Get > GET /elasticubes/{server}/{elasticube}/datasecurity 3. Take the response body and paste it in notepad++ 4. Run the following replaces commands to clean your script - Make sure you on "Regular expression" and "Wrap around" Replace .*"_id":.* With Empty Replace .*"cubeId":.* With Empty Replace .*"server":.* With Empty Replace partyId With party 5. Once this is done check if you don't have an extra comma in the end of the script and run the script in a JS Validator to make sure there are no errors. 6. Run the POST /elasticubes/{server}/{elasticube}/datasecurity with the set name and the script1KViews0likes0CommentsSwitching All Dashboards Sources From One Source To Another
In some cases user would like to change the source of all dashboards that are using one source to a different source. This can be a time consuming process if you have multiple dashboards. Instead of changing one dashboard at a time, there's a way to do so all at once. Open your Admin page and go to the REST API section In V1 go to Admin > POST /dashboards/{server}/{title}/replace_datasource In Server enter the name the name of the server *If you are using localhost - Enter LocalHost with uppercase "L" and "H" Title Enter the name of the old data source name. In Datasource it can be a bit tricky, what I will recommend is switching one dashboard manually to the new data source and exporting it to a .dash file > Open the dash file using notepad and copy the data-source section: It should look something like this { "title": "Sample ECommerce", "id": "aLOCALHOST_aSAMPLEIAAaECOMMERCE", "address": "LocalHost", "database": "aSampleIAAaECommerce" } Press Run1KViews1like0Comments