User Profile
singam_santhu
New Member
Joined 1 year ago
User Widgets
Contributions
Re: How to Authenticate a REST API in Power BI?
1. Register the App. in Azure Portal 2. Add the permissions to the App by usine API Permissions tab, 3. Use this script for token creation 4. For extracting reports for entire organization, let token = Access_Token(), headers = [ #"Authorization" = "Bearer " & token, #"Content-Type" = "application/json" ], GetPage = (url as text) as record => let response = Web.Contents(url, [Headers = headers]), json = Json.Document(response), data = json[value], nextLink = try Record.Field(json, "@odata.nextLink") otherwise null in [Data = data, Next = nextLink], GetAllPages = (url as text, acc as list) => let page = GetPage(url), combined = List.Combine({acc, page[Data]}), result = if page[Next] <> null then @GetAllPages(page[Next], combined) else combined in result, // ✅ Use includeMetadata=true here baseUrl = "https://api.powerbi.com/v1.0/myorg/admin/reports?&includeMetadata=true", allData = GetAllPages(baseUrl, {}), Reports = Table.FromRecords(allData) in Reports 5. chnage the api in the (baseURL) link for your requirement.22KViews1like0Comments
Data Privacy
Microsoft Fabric Community and Privacy
To learn more about how we manage your data, please review the Microsoft Fabric Community Data Privacy guide.