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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Sam2023
Frequent Visitor

PowerBi - Getting 404 but works in Postman

I have some issues with Powerbi which is driving me insane.

 

Essentially, I have an API endpoint which accepts a JSON body:

{key1:"value1",key2:"value2"}

It is a GET request on an endpoint: https://website.com/api/v1/endpoint

When making the GET request in Postman, everything works fine, and it outputs the response with HTTP 200 OK. In PowerBi (blank query) however, it is returning a 404. I did a console.log on the endpoint, it outputs with Postman, but doesn't output when the same request is made from PowerBi (making me believe its not even reaching the URL).

 

The Postman body looks like this:

 

Sam2023_4-1702588931118.png

 

 

In PowerBi, I am doing this:

= let url = "https://website.com/api/v1/endpoint",
    body = "{""key1"": ""value1"",""key2"": ""value2""}",
    header = [#"Content-Type"= "application/json"],
    response = Web.Contents(url, [Content=Text.ToBinary(body),Headers = header]), 
    Source = Json.Document(response)

in
    Source

I am getting this as a response:

 

Sam2023_5-1702588961296.png

 

 

What is strange, is if I changed the PowerBi Text.ToBinary(body) to Json.FromValue(body), it does reach the endpoint and I can see in the console.log output, the following:

SyntaxError: Unexpected token " in JSON at position 0
    at JSON.parse (<anonymous>)

PowerBi also returns this as an error (note this time it is a 400 and not a 404):

 

Sam2023_6-1702588992859.png

 

 

Any help would be massively appreciated!

The response from the API would return a JSON object which I would then parse into PowerBi as a dataset.

1 ACCEPTED SOLUTION
Sam2023
Frequent Visitor

Thank you for the reply. 

 

I should have been a bit more clear in my question. 

 

The API requires the authentication and key:values in the body. It doesn't have support for url parameters. 

 

 

 

 

View solution in original post

3 REPLIES 3
Sam2023
Frequent Visitor

Thank you for the reply. 

 

I should have been a bit more clear in my question. 

 

The API requires the authentication and key:values in the body. It doesn't have support for url parameters. 

 

 

 

 

Anonymous
Not applicable

HI @Sam2023,

I'm glad to here you find the root casing about this issue.

Regards,

Xiaoxin Sheng

Anonymous
Not applicable

Hi @Sam2023,

Perhaps you can try to add optional parameters(e.g. relative path, authorization token in header) to the web connector if it help for your getting data operations:

Using The RelativePath And Query Options With Web.Contents () In Power Bi M Code 

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.