cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Microsoft safalkishore
Microsoft

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

Accepted Solutions
Highlighted
Microsoft safalkishore
Microsoft

Re: Power BI Visual calling into REST APIs (POST method)

1 REPLY 1
Highlighted
Microsoft safalkishore
Microsoft

Re: Power BI Visual calling into REST APIs (POST method)

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors