Forum Discussion

ihavequestionto's avatar
ihavequestionto
Frequent Visitor
1 year ago
Solved

Invalid Connection Credentials When Adding API to On‑premises Data Gateway

Hello,

When adding the API https://api.mktzap.com.br/company/:company_id/historycontact  to my On‑premises Data Gateway, I received the following error:

Cannot refresh connection credentials. Invalid connection credentials.
Details: TIFGVTN-FILE: The credentials provided for the Web source are invalid. (Source at https://api.mktzap.com.br/company/3844/historycontact .)

Please have this information on hand if you decide to open a support ticket: Session ID: 58c075f4-8bf0-4050-a8b1-d603659a3872; RequestId: 510de280-d8c3-4798-a149-e3bdadf0ee3b; Cluster URI: https://api.powerbi.com ; Status Code: 400; Time: Tue Apr 22 2025 08:40:20 GMT-0300 (Brasilia Standard Time).

However, when I added a different endpoint (https://api.mktzap.com.br/company-channels/:company_id ) using the exact same settings, I had no issues.

Here is the public API documentation I’m using: https://apidoc.mktzap.com.br/ 

How can I add the /company/:company_id/historycontact endpoint to the gateway so that I can successfully refresh my reports?

  • ihavequestionto's avatar
    ihavequestionto
    1 year ago

    Power BI Gateway Data Refresh Issue Resolution
    Troubleshooting Steps
    During a support call with Microsoft, assistance was provided and various tests were conducted to diagnose the issue.
    The solution involved creating a Generation 1 (Gen1) dataflow in Power BI. In this dataflow, a table was created to store the token generation link.
    The M code used in Power Query in Power BI Desktop was copied and pasted into the dataflow to enable data retrieval via the alternate link (this alternate link had been preventing the on-premises data gateway from refreshing data in the Power BI Service).
    Once the dataflow connection was added in the on-premises data gateway, the Power BI Service scheduled refresh was able to update the data successfully.

13 Replies

  • there is no need to add the historycontact endpoint. Implement a custom action in your connector that adds it as a relative parameter.

  • v-pnaroju-msft's avatar
    v-pnaroju-msft
    Community Support

    Thankyou, lbendlin, for your response.

    Hi ihavequestionto,

    We appreciate your inquiry submitted through the Microsoft Fabric Community Forum.

    As per my understanding, the issue arises because Power BI Service and Gateway require a valid and reachable Base URL during data refresh. In your case, accessing only api.mktzap.com.br/ returns a "404 Not Found" error, which leads to the gateway authentication failure. While Power BI Desktop may sometimes handle this scenario more leniently, the Service necessitates a successful connection even to the base URL.

    Kindly follow the steps below, which may help to resolve the issue:

    1. Update your API connection so that the Base URL points to a valid path—for example, api.mktzap.com.br/company/ instead of the root URL alone.
    2. Use the RelativePath and Query options to append the specific endpoint (such as /historycontact) and any query parameters like x-page.
    3. Ensure that in Power BI Service, the Authentication Method is set to Anonymous (particularly if you are using Bearer tokens in the headers) and the Privacy Level is set to None.

     

    If you find our response helpful, kindly mark it as the accepted solution and provide kudos. Your support will be beneficial to other community members encountering similar queries.

    Thank you.

  • v-pnaroju-msft's avatar
    v-pnaroju-msft
    Community Support

    Hi ihavequestionto,

    We have not received a response from you regarding the query and were following up to check if you have found a resolution. If you have identified a solution, we kindly request you to share it with the community, as it may be helpful to others facing a similar issue.

    If you find the response helpful, please mark it as the accepted solution and provide kudos, as this will help other members with similar queries.

    Thank you.

  • v-pnaroju-msft's avatar
    v-pnaroju-msft
    Community Support

    Hi ihavequestionto,

    We wanted to check in regarding your query, as we have not heard back from you. If you have resolved the issue, sharing the solution with the community would be greatly appreciated and could help others encountering similar challenges.

    If you found our response useful, kindly mark it as the accepted solution and provide kudos to guide other members.

    Thank you.

    • ihavequestionto's avatar
      ihavequestionto
      Frequent Visitor

      Hello, unfortunately I haven’t been able to run the tests yet because of work, but I am extremely grateful for the response. And yes, I will let you know after I complete the tests.

  • v-pnaroju-msft's avatar
    v-pnaroju-msft
    Community Support

    Hi ihavequestionto,

    We are following up to see if your query has been resolved. Should you have identified a solution, we kindly request you to share it with the community to assist others facing similar issues.

    If our response was helpful, please mark it as the accepted solution and provide kudos, as this helps the broader community.

    Thank you.

    • ihavequestionto's avatar
      ihavequestionto
      Frequent Visitor

      Power BI Gateway Data Refresh Issue Resolution
      Troubleshooting Steps
      During a support call with Microsoft, assistance was provided and various tests were conducted to diagnose the issue.
      The solution involved creating a Generation 1 (Gen1) dataflow in Power BI. In this dataflow, a table was created to store the token generation link.
      The M code used in Power Query in Power BI Desktop was copied and pasted into the dataflow to enable data retrieval via the alternate link (this alternate link had been preventing the on-premises data gateway from refreshing data in the Power BI Service).
      Once the dataflow connection was added in the on-premises data gateway, the Power BI Service scheduled refresh was able to update the data successfully.

  • v-pnaroju-msft's avatar
    v-pnaroju-msft
    Community Support

    Hi ihavequestionto,

    Thank you for the update and sharing your insights and approach in resolving the issue.

    We kindly request you to mark your response as the accepted solution, as this will help other community members find answers to similar challenges more efficiently.Please continue leveraging the Fabric Community for any further assistance with your queries.

    Thank you.