Share via

Update Task using Graph API - Postman : IF-Match header must be specified issue

Anonymous
Sep 6, 2022, 5:45 AM

HI

I am trying to update a task using postman. I have used this body from Microsoft documentation.

PATCH https://graph.microsoft.com/v1.0/planner/tasks/{task-id}  
Content-type: application/json  
Prefer: return=representation  
If-Match: W/"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAWCc="  
  
{  
  "assignments": {  
    "fbab97d0-4932-4511-b675-204639209557": {  
      "@odata.type": "#microsoft.graph.plannerAssignment",  
      "orderHint": "N9917 U2883!"  
    }  
  },  
  "appliedCategories": {  
    "category3": true,  
    "category4": false  
  }  
}  

When i sent it in postman, it showed this below error

{  
    "error": {  
        "code": "",  
        "message": "The If-Match header must be specified for this kind of request.",  
        "innerError": {  
            "date": "2022-09-06T05:32:39",  
            "request-id": "7b55c7bc-d09a-498c-b8be-66338427cfa3",  
            "client-request-id": "7b55c7bc-d09a-498c-b8be-66338427cfa3"  
        }  
    }  
}  

I have entered the If-Match header in the Headers section of Postman and also in the body. (Refer the below image)

238024-2.png

237945-3.png

I don't know where else to update the If-Match header content

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,579 questions
0 comments No comments
{count} votes

Accepted answer
  1. Srinivasa Rao Darna 6,761 Reputation points Microsoft External Staff
    Sep 6, 2022, 12:50 PM

    Hi @Anonymous ,

    It appears you are using etag in wrong format, If-Match: W/"JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAWCc=" ideally you should be using in this format If-Match: "JzEtVGFzayAgQEBAQEBAQEBAQEBAQEBAWCc=".

    You can also refer to a similar post >> Graph - The If-Match header must be specified for this kind of request

    Hope this helps.
    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    2 people found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.