Forum Discussion

js15's avatar
js15
Icon for Helper I rankHelper I
1 year ago
Solved

We couldn't authenticate with the credentials provided.

I am trying to get data from the World Trade Organization into Power BI Desktop. I have access to the API key and I have signed up for a subscription on the WTO site. I have a microsoft 365 e5 subscription. I need some help. I also tried the Web API and the organizational account, both don't work.

 

 

 

  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi js15 ,
    Thanks for confirming that the API works in the browser and likely in Postman too , that is really helpful.
    The issue might be with how the API key is being passed. Power BI Web API authentication screen does not always handle API keys the way some services expect, especially if a specific header name like Authorization is required. Instead of using that screen, try using the Web connector with the Advanced option. This lets you manually enter the full API URL and add a custom header. For example, if the WTO API expects the key as a Bearer token, you may add a header like Authorization with the value Bearer YOUR_API_KEY, or just the key if that is what the documentation says. This approach gives you more control over the request and usually works better for APIs that are not tied to a username/password or organizational login.

    Refer the document here for more information:
    https://learn.microsoft.com/en-us/power-query/connector-authentication 
    https://learn.microsoft.com/en-us/power-query/connectors/web/web-troubleshoot 
    https://learn.microsoft.com/en-us/power-query/handling-authentication 

    If this solution resolve your query,consider accepting it as solution.

    Regards,
    Pallavi.

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi js15 ,
    Thanks for reaching out about getting WTO data into Power BI Desktop. To resolve the issues with Web API and organizational account methods, could you share:

    • Does the endpoint work in Postman or a browser?
    • Does any data load, or is it limited (e.g., 100 records, suggesting pagination)?

    Thank you for your cooperation.

    Regards,
    Pallavi.

     

     

    • js15's avatar
      js15
      Icon for Helper I rankHelper I

      Yeah, the API works inside a browser, and probably through postman, too. But it does not work through power bi, for some reason and there is no data loading it doesn't even get passed that screen.

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi js15 ,
        Thanks for confirming that the API works in the browser and likely in Postman too , that is really helpful.
        The issue might be with how the API key is being passed. Power BI Web API authentication screen does not always handle API keys the way some services expect, especially if a specific header name like Authorization is required. Instead of using that screen, try using the Web connector with the Advanced option. This lets you manually enter the full API URL and add a custom header. For example, if the WTO API expects the key as a Bearer token, you may add a header like Authorization with the value Bearer YOUR_API_KEY, or just the key if that is what the documentation says. This approach gives you more control over the request and usually works better for APIs that are not tied to a username/password or organizational login.

        Refer the document here for more information:
        https://learn.microsoft.com/en-us/power-query/connector-authentication 
        https://learn.microsoft.com/en-us/power-query/connectors/web/web-troubleshoot 
        https://learn.microsoft.com/en-us/power-query/handling-authentication 

        If this solution resolve your query,consider accepting it as solution.

        Regards,
        Pallavi.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi js15 ,
    I wanted to check in on your situation regarding the issue. Have you resolved it? If you have, please consider marking the reply that helped you or sharing your solution. It would be greatly appreciated by others in the community who may have the same question.
    Thank you.