Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowTry your skills in the Power BI Dataviz World Championship! Round one ends June 26. Join now
I an unable to get visual ID from the pages :
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 12 00:13:23 2023
@author: MAnish Chauhan | +91-(9774083186) |
"""
# Importing Pacakages
import requests
import msal
import pprint
# Defining the variables
# app id - Client ID from Azure application
app_id='-'
# Tenant Id - ID from the azure application
tenant_id = '-'
# auth_url - Default Value with dynamic tenant
auth_url = 'https://login.microsoftonline.com/' + tenant_id
# scope - default value
scope = ['https://analysis.windows.net/powerbi/api/.default']
# Azure application secret code value
client_secret='-'
# User credentials
username = '-' # Replace with your username
password = '-' # Replace with your password
# Getting the access token using username and password
app = msal.PublicClientApplication(app_id, authority=auth_url)
result = app.acquire_token_by_username_password(username, password, scopes=scope)
# Checkpoint
#print(response)
access_token=response.get('access_token')
#print(access_token)
report_id='b31696d7-5e7d-4a3e-80b8-f96d633da8db'
workspace_id='*****************************************'
#endpoint- API endpoint for the service which needs to be accesssed
endpoint="https://api.powerbi.com/v1.0/myorg/groups/*********************/reports/*******************/pages/Re..."
#endpoint= 'https://api.powerbi.com/v1.0/myorg/groups/'+Workspace_ID+'/dashboards'
#endpoint= 'https://api.powerbi.com/v1.0/myorg/groups/'+Workspace_ID+'/datasets/cab13d40-d7df-4296-8d00-8affd86b...'
#Headers for authorization
The code works fine until given end point , however I am not able to get endpoint which gives me the visual ID
headers={
'Authorization': 'Bearer '+access_token
}
response_dataset=requests.get(endpoint, headers=headers)
#print(response_dataset)
#pprint.pprint(response_dataset.json())
print(response_dataset.status_code)
Use the embedded playground to retrieve the visual ID.
Once you have it, what do you plan to do with it?
Thanks for suggesting , i will try that. Post getting the visual id , plan is to somehow export data of the visual through python.
You can use the "Export to PNG" API call.
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 16 | |
| 11 | |
| 11 | |
| 8 | |
| 7 |
| User | Count |
|---|---|
| 41 | |
| 36 | |
| 35 | |
| 35 | |
| 20 |