cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
apenaranda
Helper IV
Helper IV

Def all_workshop

Hello,
Can someone help me with the following code?
I want to show a list of the work areas of a powerbi user. At the moment this code simply logs me in with a user external to O365 (it is a user of a mysql database) but I would like to test the code and manually pass a real O365 user
I have two doubts:

  • How can I pass the username manually?
  • How do I show the results on another page?

Code:

 

def all_workshop(app,session):
    url='https://api.powerbi.com/v1.0/myorg/groups'
    api_response = requests.get(url, headers=get_request_header(app,session))
    if api_response.status_code != 200:
        abort(api_response.status_code, description=f'Error while retrieving Embed URL\n{api_response.reason}:\t{api_response.text}\nRequestId:\t{api_response.headers.get("RequestId")}')
    api_response = json.loads(api_response.text)
    api_response['value']
    return (api_response['value'])

 

 

Thank you.

 
0 REPLIES 0

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.