Forum Discussion

JoseAntonioB's avatar
JoseAntonioB
New Member
3 years ago
Solved

Json.Document error: 404 Not found

Hi,

I am doing the following command, and I got a 404 Error (resource not found), although If I make the same request in Postman or Apiary, it works fine.

 

let

Source = Json.Document(Web.Contents("https://sandbox.api.accredible.com/v1/issuer/groups/search", [Headers=[#"Content-Type"="application/json", Authorization="Token token=MyTokenKey"]]))

in

Source

 

The error message is the following:

 

DataSource.Error: Web.Contents failed to get contents from 'https://sandbox.api.accredible.com/v1/issuer/groups/search' (404): Not Found
Details:
DataSourceKind=Web
DataSourcePath=https://sandbox.api.accredible.com/v1/issuer/groups/search
Url=https://sandbox.api.accredible.com/v1/issuer/groups/search

 

It is also rare because some API requests from this platform have the same behavior, but others don't.

 

Can someone give a hand on this? I appreciate any help you can provide.

  • Stephan, I finally found what the error was but not its solution. Power Query is built to handle automatically GET endpoints but not POST. There are a few articles on the Web regarding how to make a POST in Power Query but they a very obscure and specific case oriented. Power Query did not handle POST endpoints as, for example, Postman does. I hope this feature will be implemented in the near future since is part of the basics of REST APIs.

    Thanks for your help!

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi JoseAntonioB ,

     

    The error message indicates that the resource you are trying to access is not found. The error could be due to a variety of reasons, such as incorrect URL, incorrect credentials, or the resource is not available. You mentioned that the same request works fine in Postman or Apiary, which suggests that the issue might be with the Power BI service.

     

    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.           

    • JoseAntonioB's avatar
      JoseAntonioB
      New Member

      Stephan, thanks for your help!

      I agree with your diagnostic, but I don't believe a Power Query bug causes this. The most probable thing is that something is missing or wrong with my input.

      Is there something like an "inspector" where I can see precisely what Power Query is sending to the server?

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi JoseAntonioB ,

         

        Yes, you can enable tracing for Power Query in Power BI Desktop to see precisely what Power Query is sending to the server. To enable tracing, go to File >> Options and settings >> Options. Put a check-in Enable Tracing. You can also click on Open traces folder to get to where the data is logged. Please refer to

        How to generate Power BI Desktop traces for troubleshooting : BI Connector

        Power BI Desktop diagnostics collection - Power BI | Microsoft Learn

                                                                                                                                                                 

        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.