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 subscr...
  • 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.