MS Graph Post Request - Rest API

Hi,

I was hoping someone could provide a walkthrough on updating a user' department using Microsoft Graph.
The header should be {"Content-Type": "application/json"} and the request body is {
"department": "Sales & Marketing"
}

I'm having trouble getting the parameters, headers and body set up properly. Feedback is appreciated. Thank you.



I see two problems:

  • The parameter name is invalid - [contenttype] is not a valid C# identifier. Remove the [].
  • When the payload is JSON you shouldn't use string as the type. Either use an existing custom class for it or dynamic. Then in the dialog enter the JSON.

Thank you, Korchev. The changes you suggested have been made. Unfortunately, it is still not working. When I select "send" to test the method this error is returned: "Specified HTTP method is not allowed for the request target." I've tried both post and put. It seems like MS Graph requires a Patch to update a user record. I am able to reproduce the error message in graph explorer and here is an [article] (How to update existing user in Azure AD using Microsoft Graph API - Stack Overflow) confirming this. I've also tried updating the code from put to patch but the gui doesn't update. Any suggestions? Thank you.

We will add support for PATCH methods in the REST data source in one of the next releases.

Thank you for your response, Korchev.