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

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
AmanShaikh
Frequent Visitor

accessToken error issue while calling API through REST connector

Hi All,

I am facing issue while calling REST API through REST connector in Fabric using Service Principal Authentication. Where to pass this accessToken ?

Screenshot 2024-07-04 105430.png

4 REPLIES 4
Anonymous
Not applicable

Hi  @AmanShaikh ,

Have you solved your problem? If so, can you share your solution here and mark the correct answer as a standard answer to help other members find it faster? Thank you very much for your kind cooperation!

 

 

Best Regards

Yilong Zhou

 

Hi @Anonymous
I was trying to get data from API, but now I am using other solution to get data from the source. So I didn't try this.

Thanks

Anonymous
Not applicable

Hi @AmanShaikh ,

I'm glad you found another way to solve your problem, could you please share your method?

If you can, I'm sure it can help other users on the forum!

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @AmanShaikh ,

It looks like you are experiencing issues with the accessToken parameter not being passed correctly when calling the REST API through the REST connector in the fabric using service principal authentication, the accessToken on the screenshot is currently null.

 

I think the first thing you can do is to generate it using a tool like Postman or programmatically in code, you can try the following Postman code for generating the token.

POST https://login.microsoftonline.com/{tenantId}/oauth2/v2.0/token
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials
client_id={your-client-id}
client_secret={your-client-secret}
scope=https://api.fabric.microsoft.com/.default

 

 Once you have the access token, you need to include it in the headers of your REST API request. Typically, this is done by adding an Authorization header with the value Bearer {accessToken}.

 

Also you need to make sure that the service principal has the necessary permissions to access the Fabric APIs. This includes adding the service principal to the Fabric workspaces with at least a Contributor role.

 

 

 

Best Regards

Yilong Zhou

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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 FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric 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.