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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
safalkishore
Microsoft Employee
Microsoft Employee

Power BI Visual calling into REST APIs

I am developing a sample power bi visual after following the article - https://docs.microsoft.com/en-us/power-bi/developer/visuals/custom-visual-develop-tutorial

 

I am trying to use the 'request' npm package on the 'visuals.ts' on the constructor and then call into a custom API like the sample code shown below:

 

 console.log('error:', error); // Print the error if one occurred
 console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received
 console.log('body:', body); // Print the HTML for the Google homepage.
 });
 
I encounter an error on the 'pbiviz start' phase while trying the above. 
 
Hence trying to check if this is allowed and how I could go about looking up the build error
1 ACCEPTED SOLUTION
2 REPLIES 2
safalkishore
Microsoft Employee
Microsoft Employee

Also tried setting the library as shown on this page - https://github.com/microsoft/PowerBI-visuals/blob/master/Tutorial/ExternalLibraries.md#including-jav...

 

    },
    "externalJS": [
        "node_modules/request/request.js"
      ],
 
Yet the error persists

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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