Forum Discussion

Kalemstorm's avatar
Kalemstorm
Regular Visitor
8 years ago

Push data to dataset from Javascript/Typescript

Hello!

I've created a dashboard and a streaming dataset on https://app.powerbi.com/.  When I try to push data from C#/Python to that dataset it works perfectly, but if I try to use Typescript, it keeps giving me the 404 NOT FOUND, on the same streaming dataset push URL.

 

 public sendPowerBi(url: string, data: any) {

      return this.http
        .put(url, JSON.stringify(data), { headers: this.headers }).subscribe();
    }

where

this.headers = new Headers({
      'Content-Type': 'application/json',
    });

Here I don't have an access token.  Can you please give me a suggestion?

5 Replies

Replies have been turned off for this discussion
  • Kalemstorm's avatar
    Kalemstorm
    Regular Visitor

    Hello!

    I've created a dashboard and a streaming dataset on https://app.powerbi.com/.  When I try to push data from C#/Python to that dataset it works perfectly, but if I try to use Typescript, it keeps giving me the 404 NOT FOUND, on the same streaming dataset push URL.

     

    public sendPowerBi(url: string, data: any) {
    
          return this.http
            .put(url, JSON.stringify(data), { headers: this.headers }).subscribe();
        }

    where

    this.headers = new Headers({
          'Content-Type': 'application/json',
        });

    Here I don't have an access token.  Can you please give me a suggestion?

    • v-ljerr-msft's avatar
      v-ljerr-msft
      Microsoft Employee

      Hi Kalemstorm,

       

      Could you try using POST requests instead of PUT to push your data to Power BI streaming data dataset you created to see if it works? :smileyhappy:

      public sendPowerBi(url: string, data: any) {
      
            return this.http
              .post(url, JSON.stringify(data), { headers: this.headers }).subscribe();
          }

      Regards

      • Kalemstorm's avatar
        Kalemstorm
        Regular Visitor

        I've already tried that. Actually, I've tried it before PUT and I've asked the question only after...