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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Custom Connector - Gra...
Power Automate
Answered

Custom Connector - Graph - The If-Match header must be specified for this kind of request

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I would like to do a PATCH against the Microsoft Graph API, e.g. https://graph.microsoft.com/v1.0/planner/tasks/{task-id}

 

Unfortunately, the Custom Connector wraps the If-Match Header in quotes which causes Graph to return a 412: "The If-Match header must be specified for this kind of request". This is the header that it generates:

 

{
 "Authorization": "Bearer eyJ0eXA...",
 "Content-type": "application/json",
 "If-Match": "W/\\\"JzEtVGFza0Rld...TCc=\\\""
}

In the Graph Explorer, if I wrap the If-Match Header value in quotes I repro the same result.

 

So, it looks like the root cause is the fact that the Custom Connector is wrapping the etag in quotes is the problem. I've tried all of the other data types for the Header values, and it wraps them all in quotes.

 

Seems a pretty basic thing to me (to do a PATCH to the Graph) - what am I missing please community!

Categories:
I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I found my own answer: my problem was the weak etag syntax that I was using. It does not like this:

     

    W/\"JzEtVG...TCc=\"

     

    nor does it like this:

     

    JzEtVG...TCc=

     

    but it does like this:

     

    "JzEtVG...TCc"

     

    which it (double, escape) wraps in quotes to looks like this, and which works.  

    {
     "Authorization": "Bearer eyJ0e...",
     "Content-type": "application/json",
     "If-Match": "\"JzEtVG...TCc=\""
    }

     

  • mousman85 Profile Picture
    196 on at

    Long shot but i'm having real issues with this still. Below is my query in Graph but can't seem to get any of it to work no matter what format I use for the if-match, I need to be able to update the convthreadID in a task but cannot seem to even change the title:

    mousman85_0-1649670845826.png

     

  • alanfsrz Profile Picture
    8 on at

    your answer is not clear enough.

     

    You mentioned that the "@odata.etag" value has to be grabbed from a GET response, prior to using it in a PATCH. That is correct.

     

    However, there are 2 different APIs for a task,

    https://graph.microsoft.com/v1.0/planner/tasks/{task-id}

    and 

    https://graph.microsoft.com/v1.0/planner/tasks/{task-id}/details

     

    Both have their GET and PATCH calls, hence you should get the etag value from the correct API prior to make a PATCH.

     

    It is easy to get confused and treat it as one API and use the PATCH sample given by Graph Explorer while trying to edit on the second API which is incorrect.

     

    It is also necessary to clarify that the etag showed on Graph Explorer needs to get formatted, by erasing the escape character symbols "\"and the "W/"from the begging which indicates a weak entity tag, not taken by the API:

    ex: value from GET call:

        "@odata.etag": "W/\"JzEtVGFza0RldGFpbHMgQEBAQEBAQEBAQEBAQEBAcCc=\"",

    value to use in the PATCH call:

        "JzEtVGFza0RldGFpbHMgQEBAQEBAQEBAQEBAQEBAcCc="

  • MattiasP1 Profile Picture
    138 on at

    Saved me alot of time. Thanks !

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 552

#2
Valantis Profile Picture

Valantis 388

#3
11manish Profile Picture

11manish 375

Last 30 days Overall leaderboard