Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
apenaranda
Post Patron
Post Patron

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.