@api
2 TopicsUser account access to the dashboard via API
Good afternoon! We have a very important and urgent task. As you all know, you can give access to a specific Power BI dashboard in the Report Server version to a specific user account or Active Directory group (through the interface in Management-Security). In our case, we cannot give access to a group, and when a request comes in for 100+ users to access a specific dashboard, it is not possible to add them one by one. In this regard, the idea came up to create a python script in which to add users through the PBIRS API. But the problem is, which of the API to use for this? There are many methods on the site, what should we apply for this task? https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/info Also thought about adding through SQL Server to system tables, but the method is very risky for the server's performance, so we abandoned it. Please help us, I can't believe that there is no other method besides using Active Directory groups.Solved2KViews0likes10CommentsUpload pbix with python
Hi! I have Power BI Report Server May 2022 and i try to upload pbix-file use api. I write this code: from asyncio.windows_events import NULL from requests import request import requests from requests_toolbelt.multipart.encoder import MultipartEncoder import json from requests_ntlm import HttpNtlmAuth from urllib3.exceptions import InsecureRequestWarning from urllib3 import disable_warnings disable_warnings(InsecureRequestWarning) urlpbirs = "https://pbirs.ontoso.com/reports/api/v2.0/PowerBIReports" file = open("testapi.pbix", "rb") file_location = "testapi.pbix" files = {'value': (None, open(file_location, 'rb'), 'multipart/form-data')} mp_encoder = MultipartEncoder(fields=files) headers = { 'accept': 'application/json', # Already added when you pass json= but not when you pass data= # 'Content-Type': 'application/json', } json_data = { 'Name': 'test', 'Description': 'test api with python', 'Type': 'PowerBIReport', 'Hidden': False, 'IsFavorite': False, 'ContentType': NULL, 'Content': '', 'HasDataSources': True, 'Path': '/BI Test' } r = requests.post(url=urlpbirs, data=mp_encoder, auth=HttpNtlmAuth( 'user', 'pass'), verify=False, headers=headers, json=json_data) But it doesn't work2KViews0likes2Comments