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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
sato89
Helper I
Helper I

REST API calls with typescript-angular library

Hi everyone.

I developed an angular app with the typescript-angular PBI library downloaded here: https://app.swaggerhub.com/apis/microsoft-rs/PBIRS/2.0#/Session/CreateSession.

I have a PBI Server on-premise with some reports.

For example I call the createSession method from SessionService with these user credential object:

 
class Credentials implements UserCredentials{
userName = "...";
password = "...";
domain = "...";
}
with these informations:
- userName = second part of userName field of a user get from the Users table in PBI database after the "\" (domain\username)
- password = the password
- domain = first part of userName field of a user get from the Users table in PBI database before the "\" (domain\username)
 
I receive always 400 BAD REQUEST from this call:
 
this.sessionSrv.createSession(cred).subscribe(result =>{
console.log("login result", result);
},
error =>{
console.log("login error", error);
});
 
in app.module.ts I add this in "providers array:
{provide: BASE_PATH, useValue: '<PBI web portal URL from Report Server Configuration Manager>'}
 
What am I doing wrong? Do I need to make configurations on my PBI Server side to activate the rest api?
Thank you in advance.
 
Best regards.
0 REPLIES 0

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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