user3394
user3394

Reputation: 31

Unable to modify existing properties of groups from Graph API

I am trying to modify the existing Azure Ad group display name and description from Microsoft Graph API. I am using the query below:

PUT
https://graph.microsoft.com/v1.0/groups/mygroupobjectid

Body
{
"displayName": "Test_Group1",
"description": "This is my test group",
"groupTypes": [
"Unified"
],
"mailEnabled": true
}

But I am getting the response like below:

{
"error": {
"code": "Request_BadRequest",
"message": "Specified HTTP method is not allowed for the request target.",
"innerError": {
"date": "2022-06-15T10:32:53",
"request-id": "253a0a13-f721-4798-911f-d3ab3903da17",
"client-request-id": "8de28bb9-bafe-d186-264d-db614b05a67f"
}
}
}

Can anyone suggest what I am doing wrong? Any help will be appreciated

Upvotes: 0

Views: 267

Answers (1)

Sridevi
Sridevi

Reputation: 22222

Please note that, you need to use PATCH method to update properties of existing Azure AD groups via Microsoft Graph API as stated in this MsDoc.

I tried to reproduce the same in my environment like below:

Before updating, my group has properties like this:

enter image description here

To update those properties, I ran query like below:

enter image description here

After executing the above query, properties are updated successfully like below:

enter image description here

Upvotes: 1

Related Questions