web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / HTTP POST Action - Bad...
Power Automate
Unanswered

HTTP POST Action - Bad Request

(0) ShareShare
ReportReport
Posted on by 104

Hello,

 

Stumped with an error message in a http post request to MS Graph - Groups endpoint.

 

Error message says I need to add a content-type in the header but I have already done this - and in fact you can actually see the content-type header in the error:

 

error.PNG

 

Why is this happening?

 

Thanks

Categories:
I have the same question (0)
  • v-litu-msft Profile Picture
    on at

    Hi @JT_Corrin,

     

    Could you share the configuration of your Flow? You can have a try the following configuration of the header:

    Annotation 2020-01-17 100411.png

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • JT_Corrin Profile Picture
    104 on at

    Thanks for the response, @v-litu-msft 

     

    I am taking values from Powerapps and setting Groups ownerships in Flow using group IDs and member IDs. I am ultimately using this method: https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Extend-Microsoft-Flow-with-the-Microsoft-Graph-and-0-code/ba-p/61662

     

    And I have also tried the method using the 'secret' method of authentication.

     

    Here is another shot:

     

    error2.PNG

     

    Getting the authorization token is successful. Now I have updated my header as per your suggestion i get the error response: "Request Type Not Supported"

     

    {
    "error": {
    "code": "BadRequest",
    "message": "Request type is not supported.",
    "innerError": {
    "request-id": "28710a3f-16f9-4c07-ab68-6ef67f5e64b8",
    "date": "2020-01-17T07:36:09"
    }
    }
    }
     
    Thanks for your support
  • JT_Corrin Profile Picture
    104 on at

    Turns out the group id was different to the ID i was using. I should have been using ExternalDirectoryObjectID. As far as I can see this is mentioned nowhere in the api docs. 

     

    The flow then prompted me to remove the ";odata=verbose" from my content type and accept header. 

  • JT_Corrin Profile Picture
    104 on at

    Now it turns out that the above, although able to GET the group, it is not able to POST a member ID as owner. 

     

    @v-litu-msft  How can I do this:

     

    https://docs.microsoft.com/en-us/graph/api/group-post-owners?view=graph-rest-1.0&tabs=http

     

    Quote:

     

     

    POST https://graph.microsoft.com/v1.0/groups/{id}/owners/$ref
    
    Content-type: application/json
    
    Content-length: 30
    
    {
    
    "@odata.id": "https://graph.microsoft.com/v1.0/users/{id}"
    
    }

     

     

     

    In Flow? I can't use the @ value in the https body

     

     

  • JT_Corrin Profile Picture
    104 on at

    Anyone?

     

    @v-litu-msft ?

  • Verified answer
    JT_Corrin Profile Picture
    104 on at

    Had to go to microsoft support for this one.

     

    I have not tested it yet (and I won't get chance to for a while) but for anyone else looking at the graph api and wondering how to format the body of a http POST request, you need to do a concat on the elements of the key, so the body would look something like this:

     

    {

        "concat('@', 'odata.id')": "https://...etc etc"

    }

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard