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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

POST REST API Call - Error "Access to resource is forbidden"

Hello All,

 

I have used Get calls for my REST API but have yet to refresh a token using a post call. I have the post call working in PostMan

 

The Call is- Post https://secure4.saashr.com/ta/rest/v1/login

Headers - Content-Type application/xml

Body -

<login_request>
    <credentials>
        <username>{{user}}</username>
        <password>{{password}}</password>
        <company>{{company}}</company>
    </credentials>
</login_request>
----------------------------------------------------------------
 
Here is the code I am currently using in Power BI:
let
url = "https://secure4.saashr.com/ta/rest/v1/login",
headers =[#"Content-Type"="application/json",#"Api-Key"="XXXXXXX"],
postData=
"{
""credentials"": {
""username"": ""XXXX"",
""password"": ""XXXX"",
""company"": ""XXXX""
}
}",
data = Text.ToBinary(postData),
response=Json.Document(Web.Contents(url, [Headers=headers,Content=data])),
access_token=response[token]
in
access_token
 
The error I recieve is "Access to the resource is forbidden".However I have accessed multiple times with postman and my get calls all work.

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I was silly! I figured out I was incorrectly typing in one of my keys!

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , Refer to how it has been used here

https://www.advaiya.com/generate-dynamic-token-and-get-data-from-custom-api-in-power-bi/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@amitchandak Hello, I did follow this blog post. It works perfectly for GET calls but my Post Call is denied access to the resource. Thank you for the response.

Anonymous
Not applicable

I was silly! I figured out I was incorrectly typing in one of my keys!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors