Reputation: 39
Using https://developer.microsoft.com/en-us/graph/docs/api-reference/v1.0/api/group_post_members to add a member to a group
POST /groups/{id}/members/$ref
{
"@odata.id": "https://graph.microsoft.com/v1.0/users/[email protected]"
}
returns error
{
"error": {
"code": "Request_BadRequest",
"message": "Unable to update the specified properties for objects that have originated within an external service."
}
}
The group that I'm trying to add to has the following properties:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#groups/$entity",
"id": "xxx",
"deletedDateTime": null,
"classification": null,
"createdDateTime": "2017-09-11T21:04:49Z",
"description": null,
"displayName": "xxx",
"groupTypes": [],
"mail": "[email protected]",
"mailEnabled": true,
"mailNickname": "xxx",
"onPremisesLastSyncDateTime": null,
"onPremisesProvisioningErrors": [],
"onPremisesSecurityIdentifier": null,
"onPremisesSyncEnabled": null,
"preferredDataLocation": null,
"proxyAddresses": [
"smtp:[email protected]",
"SMTP:[email protected]"
],
"renewedDateTime": "2017-09-11T21:04:49Z",
"securityEnabled": false,
"visibility": null
}
Upvotes: 1
Views: 3254
Reputation: 39
Found out that the reason for the rejection was because Microsoft only allows adding members to Office 365 Groups (groupTypes = ["Unified"])
In my case, the group properties above shows (groupTypes= [])
Upvotes: 1
Reputation: 5493
My test result for your reference.
List user ID so get user ID.
https://graph.microsoft.com/v1.0/users
Upvotes: 0