0

When creating a group in the unified API, it assigns our other domain. The code below assigns the name tgr@FuseFX.onmicrosoft.com instead of tgr@fusefx.com (fusefx.com is our default domain, and we can't remove the onmicrosoft one.)

Is there anything that I need to specify to force it to use the proper domain, or is this a bug?


POST https://graph.microsoft.com/beta/fusefx.com/groups

Content-Type: application/json

{
    "groupTypes": ["Unified"],
    "description": "Test Group",
    "displayName": "Test Group",
    "mailNickname": "tgr",
    "mailEnabled": "true",
    "securityEnabled": "true"
}
Erveron
  • 1,908
  • 2
  • 25
  • 48
cbishop
  • 63
  • 6

1 Answers1

0

Turns out that after creating the record, you can do a PATCH to update the EmailAddress, even though you can't specify this when initially creating the record. It might take several minutes to reflect this in Office 365.

So:

PATCH https://graph.microsoft.com/beta/contoso.com/groups('c75831bd-fad3-4191-9a66-280a48528679')

Content-Type: application/json

{
    "EmailAddress": "tgr@fusefx.com"
}
cbishop
  • 63
  • 6
  • 1. You have to wait at least 5 seconds before issuing a PATCH - otherwise it will not find the newly created group to change this setting. – cbishop Oct 02 '15 at 19:31
  • 2. If you remove a group and then re-add it soon, there's a good chance that it'll add numbers to your email address, i.e. tgr2@fusefx.com. – cbishop Oct 02 '15 at 19:32