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

Did you hear? There's a new SQL AI Developer certification (DP-800). Start preparing now and be one of the first to get certified. Register now

Reply
digiroo
Frequent Visitor

Using a REST API as a data source - Web.Contents Content option connecting anonymously

Hi,

 

I have another post on the community, which has been partially answered, but not resolved.

 

http://community.powerbi.com/t5/Integrations-with-Files-and/M-Query-to-use-POST-method-on-a-Web-API/...

 

I have a Web data source connecting to the Sage One API. Im using a POST method.

 

I have tested the URL, headers, content-type and content on Postman.

 

And they work fine.

 

When trying to connect via Power BI Desktop I get this error:

 

DataSource.Error: Web.Contents with the Content option is only supported when connecting anonymously.
Details:
    DataSourceKind=Web
    DataSourcePath=https://accounting.sageone.co.za/api/1.1.2/AccountBalance/Get

 

This is the code I'm using, I have tried with authorisation in the header and setting it separately in the poppup and data source settings:

 

let
body=
"{
  ""FromDate"": ""2017-01-01"",
  ""ToDate"": ""2018-01-01""
}",
url = "https://accounting.sageone.co.za/api/1.1.2/AccountBalance/Get?ApiKey={GUIDGUID}&CompanyId=123456",

Source = Json.Document(Web.Contents(url, [ Headers = [#"Content-Type"="application/json"], Content = body] ))
in Source

 

I have seen a few posts relating to this error but none with a solution that would work for this scenario.

 

Can you check this isnt a Power BI bug...

 

Thanks

 

Digiroo

 

 

 

1 ACCEPTED SOLUTION
digiroo
Frequent Visitor

Hi This has been resolved.

 

I am setting the Basic Authorisation in the header and setting credentials to Anonymous and it works fine.

 

I think the patch today has fixed 🙂

 

Thanks

 

Digiroo

View solution in original post

2 REPLIES 2
digiroo
Frequent Visitor

Hi This has been resolved.

 

I am setting the Basic Authorisation in the header and setting credentials to Anonymous and it works fine.

 

I think the patch today has fixed 🙂

 

Thanks

 

Digiroo

Anonymous
Not applicable

could you please post your code in here?
I am having trouble with anonymous credentials, it seems my header is not correctly pushing username and password values...

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.