Skip to main content

Notifications

Power Automate - Using Connectors
Answered

HTTP POST failed with 403 error, but works fine in Postman

(1) ShareShare
ReportReport
Posted on by 193

I finally figured out how to run my request successfully in postman (I have to have their Host, Content-Type, and Content-Length headers selected). Now I cannot get it to work in Flow or as a custom connector. I have tried putting content-type, length, and host in the headers and in the body and it has not worked. Continually getting a 403 error. I am new to making HTTP requests, so if there is any other information that would help, let me know. Thanks!

 

Screenshot 2021-01-25 195339.png

  • JeffSM Profile Picture
    JeffSM 2 on at
    Re: HTTP POST failed with 403 error, but works fine in Postman

    @cah2035 , could you please explain this in detail how you did , and if the body has to be in JSON format?

  • H_Jonaa01 Profile Picture
    H_Jonaa01 37 on at
    Re: HTTP POST failed with 403 error, but works fine in Postman

    I actually solved my problem today on my own 😄 

    I realized that there is a firewall in the network i am sending my requests. I assume that if i use the postman app the requests are send locally. Since Http actions of my workflow are sent from Microsoft servers, the firewall intercepts these requests.

  • Verified answer
    CAH2035 Profile Picture
    CAH2035 193 on at
    Re: HTTP POST failed with 403 error, but works fine in Postman

    @H_Jonaa01I did!

    Not sure if this will exactly work for your situation. I made a variable that contained my token and all the query filters. For the HTTP action, I only have one header Content-Type with the value application/x-www-form-urlencoded and I think this was critical for getting it to work. The for the body value, you need to use the binary function:

    cah2035_0-1699973384676.png

     

     

    So I believe both that content type and using the binary function for the request body info were what made the difference for me. Hopefully this method will also work for you.

     

     

  • H_Jonaa01 Profile Picture
    H_Jonaa01 37 on at
    Re: HTTP POST failed with 403 error, but works fine in Postman

    Hi @cah2035,

    i am facing the same problem at the moment. Have you been able to solve this issue?

  • CAH2035 Profile Picture
    CAH2035 193 on at
    Re: HTTP POST failed with 403 error, but works fine in Postman

    Hi Laura, thanks for your reply. 

     

    I am using the HTTP action under the HTTP category. I am trying to access a site run by my institution, and their instructions require a POST request rather than get (even though this request is technically just to get data from their site). 

    I have tried doing this both in Power Automate with the HTTP action as well as trying to create a custom connector which is even more confusing to use, and I get the same 403 response in both. When I first started doing this, I started with postman and was getting the same 403 error. As stated in the original post, I discovered that the request required the headers for Content-Type, Content-Length, and Host to get the request to work (these are three headers that are provided by postman, so I did not put any data in these headers myself. In fact, there were no other headers I included, the only information I put in was the body of the request. 

    Since all of the headers shown in the postman request above have values that are generated by postman itself, I am not sure how I would establish these headers in the flow. 

  • Re: HTTP POST failed with 403 error, but works fine in Postman

    Hi!


    I am not sure of what connector you are using, but here are some quick checks:

    1. Are you using the HTTP with Azure AD? A 403 could mean that your authentication is not correctly set; as stated in the limitations of this connector, if you are using AD credentials, might not have the correct scopes, try with HTTP connector.
    2. Are you using the HTTP connector? Make sure that you are setting the correct Authorization header; I suggest to start with a GET request to make tests (usually, they are simpler).
    3. If you created a custom connector, in the test tab, you can see the request your connector is sending and all the headers is attaching, I suggest sending that exact same request in Postman to make sure is working.

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,304

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard

Featured topics