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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
mitulpatelEinfo
New Member

power bi access token api working in postman but not working in Angular 6

Hi Team,

I'm calling " https://login.microsoftonline.com/common/oauth2/token " in postman it's Working fine while integrating rest API in Angular 6 

const httpOptions = {
      headers: new HttpHeaders({
        'Content-Type': 'application/x-www-form-urlencoded'
      })
    };

    const body = new HttpParams()
      .set('client_id', 'xxxxxxxxxx')
      .set('client_secret', 'xxxxxxxxxx')
      .set('grant_type', 'password')
      .set('scope', 'openid')
      .set('resource', 'https://analysis.windows.net/powerbi/api')
      .set('username', 'xxxxxxxxxx')
      .set('password', 'xxxxxxxxxx');
    return this.http.post(AppConstants.LOGIN, body.toString(), httpOptions)
      .pipe(
        map(response => response)
      );


above code which is used in Angular 6 but I'm not able to get access token, 

getting 200 status with 'null' response.

Please give me a solution to implement rest api in angular 6.



power-bi.png

0 REPLIES 0

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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