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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
safalkishore
Employee
Employee

Power BI Visual calling into REST APIs (POST method)

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 - Can't resolve 'fs' 
 
Hence trying to check if this is allowed and how I could go about looking up the build error
1 ACCEPTED SOLUTION
safalkishore
Employee
Employee
1 REPLY 1
safalkishore
Employee
Employee

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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