Getting Dashboard Data Via API
Question: Is there an API to retrieve dashboard-specific data (widgets, filters etc.)? Solution: Of course there is - the Dashboards API v1.0 For example, you can retrieve a dashboard by ID: http://localhost:8081/api/v1/dashboards/588149043aadeb6c43000012 Which will return a JSON containing various fields such as datasource (the cube used), filters, and layout. The layout is comprised of cells, and alongside the UX properties like the cell's size, you can find the widget ID for each cell. Subsequently, you can find the dashboard's widgets like so: http://localhost:8081/api/v1/dashboards/588149043aadeb6c43000012/widgets Which will return an array of all widget objects, or a specific widget like so: http://localhost:8081/api/v1/dashboards/588149043aadeb6c43000012/widgets/588149603aadeb6c43000015 Note: when specifying a widget's or dashboard's ID you need the "oid" property and not the "_id" property! You can find more information about these APIs in our Online API Reference / V1 / Dashboards2KViews0likes0CommentsSSO & Sisense API FAQs
Q. What is the difference between a JWT token and an API token ? A JWT - JSON Web Token is used to SSO into the Sisense web portal to establish a cookie based web session. An API token is used to make calls to the Sisense REST API for administrative and house keeping tasks. Q. Do I need an API token to make API calls if I have successfully signed into the Sisense portal ? No, If you have established a web session either via SSO or form based login you can make REST API calls with the browser without using a token. Q. How do I generate an API token ? The easiest way to do this is to generate it via the swagger UI in the sisense admin page. API tokens do not have an expiry. Q. When I use JWT for SSO, how does Sisense map the user to roles and groups ? Can I pass this along with the JWT ? You can only pass on the username in the JWT, the mapping of the user to Groups and Roles has to be preset in Sisense. Q. What if the user does not exist in the system at the time of the SSO ? You can dynamically create a user and assign Groups and Roles via the REST API right before you trigger the SSO.1.8KViews2likes0CommentsWhat Are The Response Codes To The /Elasticubes/Servers/{Server}/Status GET Call?
Question: I want to determine the status of my elasticubes from a REST API call. What are the return values? Solution: Based on this documentation, these are the expected statuses: - 1 - stopped - 2 - running - 4 - faulted - 8 - being deleted - 16 - currently restarting - 32 - wrong version - 64 - the ElastiCube is down because it is 32 bit data on a 64 bit codebase - 128 - the ElastiCube is down because it is 64 bit data on a 32 bit codebase - 256 - locked - 514 - the ElastiCube or its child is currently in a build process. - 1024 - the ElastiCube is starting, but not yet running. - 2048 - the ElastiCube is in a build process. - 4096 - trying to import a BigData ElastiCube on a non-BigData server - 8192 - trying to import a non-BigData ElastiCube on a BigData server - 16384 - Building is finished, now post indexing is running - 32768 - the ElastiCube is being stopped but its executable is still running - 65536 - this ElastiCube is in the process of cancelling an in-progress build1.1KViews0likes0CommentsCreating Widget Via Rest API
Question: How can I find a reference to create a widget via Rest Api? Solution: If you run a GET call on that endpoint (/dashboards/{dashboardId}/widgets), you can see how that property is stored in the JSON. Here's one example with the dim field: Generally, it's [Schema.Table.Field], plus adding (Calendar) before the closing bracket for datetime fields (as in the above example). Three other tips for your process: 1. Check out our JAQL API reference here. 2. Your best bet to learn this is to create a new dashboard with a single widget, export it to .dash, and view the .dash file in a text editor 3. You can use Postman to build and test API calls. Using the software, you can export your call to a language of your choice, including C#1.1KViews0likes0CommentsHow To Create Elasticube Using Api
Question: Which api should i use to create my elasticube? Solution: At the moment, REST API for creating Datamodels is only available on Sisense for Linux, starting from version L8.0.2. This capability should become available on the Windows version as well later this year. To get started with using the Datamodels API, here are some helpful resources: Datamodels API Guide Datamodels API Reference Datamodels API Webinar Datamodels API Demo (on GitHub!) If you are using Sisense for Windows and still need to automate the creation of Elasticubes, there are some possible approaches to do so that aren't via REST.972Views0likes0CommentsGet A List Of ALL Dashboards With Specific Fields Only
Question: I am trying to build a data set to import into an ElastiCube to see which dashboards a user has access to, among other things. This is about building a DASHBOARDS table. My GETs all come back with all fields. All I want is: dashboardId, title, shares, owner api/v1/dashboards?fields=dashboardId,title,owner,shares returns just the fields I need but only for the one user api/v1/dashboards/admin?dashboardType=owner&ownerInfo=true&ownershipType=allRoot returns all the dashboards; but way too much information. How can I limit this to just the fields I need? Answer: you can use the "fields" argument with the admin endpoint as well: /api/v1/dashboards/admin?dashboardType=owner&ownerInfo=true&ownershipType=allRoot&fields=dashboardId,title,owner,shares I get the response structure: { "title": "Sample ECommerce", "oid": "5edeac92312bbe002b67a5d1", "shares": [ { "shareId": "5ed8f9a3800b79ad85d448cc", "type": "user" } ], "owner": "5ed8f9a3800b79ad85d448cc", "ownerInfo": { "email": "[email protected]", "firstName": "moti.gra" }, "ownershipType": "owner" }956Views0likes0CommentsUpdate User Password Over API Without Email Token
Question: I cannot find a way to update user's password for Sisense via API. We can create their account over API with a password but not change it over API? Solution: You are able to define new password for a user using REST API v0.9, the endpoint is /users/{user}. It is using _id or userName as parameters and the body can be password only, or the whole user object: { "password": "[email protected]" }800Views0likes0CommentsIs it possible to enable/disable a plugin with REST API?
Question: Is it possible to enable/disable a plugin with REST API? Answer: Option 1 It is possible with the /api/plugins endpoint. Here is the script we use for a single enable/disable of a plugin; For enabling set isEnabled to True For disabling set isEnabled to False import requests url = "URL/api/v1/plugins" payload = "[{ \"name\": \"metadata\", \"lastUpdate\": \"2019-08-11T15:21:36.491Z\", \"version\": \"0\", \"isEnabled\": false, \"folderName\": \"metadata\"}]" headers = { 'accept': "application/json", 'Content-Type': "application/json", 'cache-control': "no-cache", 'Authorization': 'Bearer TOKEN' } response = requests.request("PATCH", url, data=payload, headers=headers) print(response.text)724Views0likes0CommentsGET API "/Dashboards/Export" Passing Multiple DashboardIDs
Question: I am on Sisense api page and trying the "GET /dashboards/export" to get dashboards as .dash file The input box "dashboardIds" indicates I can pass multiple dashboard ids as array string. What is the right syntax? Solution: Try passing in the list as comma separated without any spaces, it should work. Ensure you are using the dashboard's "oid" property and not "_id" - I've attached a screenshot of a working example below.691Views0likes0CommentsPosting New Users In Bulk
Question: I'm currently trying to write a console app that will do all my user administration stuff automatically, but am having a hard time making a post to the bulk ad end point that includes groups. Solution: This is currently a limitation. Possible workarounds: You can either: use POST api/v1/users and specifiy "activeDirectory": true, like this: { "email": "[email protected]", "groups": [ "5d4bfbe5bd3ef11b68180cef" ], "activeDirectory": true, "hash": null } Or you can create the users using the regular /user/ad/bulk, and then go over the ID's you are getting and make a second call to PATCH users/{id} with the groups. Both options tested and worked.578Views0likes0Comments