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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
avictoria
Frequent Visitor

Advanced Editor - API bearer

Experts,

 

Power BI data is getting from api link. I have difficulty to connect using token authenticaton . Following is my code. What i am doing wrong here. please advise. 

 

let

test = {username : Lordloc , password : ******},

AccessTokenHeader = "test" & "Bearer *" ,

Headers = [Authorization = AccessTokenHeader],

url = "https://dfsf.cdsfe.ae:3289/dede/getCusfedfsfock",


body = "{ ""plant"" : ""c051"",
""storageLocation"" : ""0001"",
""type"" : ""MARD"",
""sapid"": ""qEP""
}",


Source = Json.Document(Web.Contents(url,[
Headers = [#"Content-Type"="application/json"],
Content=Text.ToBinary(body)
])),
#"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"plant", "material", "storageLocation", "warehouseNo", "quant", "storageType", "unrestrictedStock", "stockInTfr", "qualityInsp", "restrictedUse", "blocked", "returns", "totalQuantity", "availableStock"}, {"Column1.plant", "Column1.material", "Column1.storageLocation", "Column1.warehouseNo", "Column1.quant", "Column1.storageType", "Column1.unrestrictedStock", "Column1.stockInTfr", "Column1.qualityInsp", "Column1.restrictedUse", "Column1.blocked", "Column1.returns", "Column1.totalQuantity", "Column1.availableStock"}),
#"Renamed Columns" = Table.RenameColumns(#"Expanded Column1",{{"Column1.material", "material"}, {"Column1.plant", "plant"}, {"Column1.unrestrictedStock", "unrestrictedStock"}})
in
#"Renamed Columns"

 

 

teste

3 REPLIES 3
Anonymous
Not applicable

Hi @avictoria ,

 

Does any error message appear? I can't reproduce your error scenario here.

For now, you may check the following link for reference.

Solved: How to configure Power BI REST API as a data sourc... - Microsoft Power BI Community

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

How to change API version?

avictoria
Frequent Visitor

Friends your input is much appreciated. 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors