Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Can't create Group "A value is required for property 'displayName' of resource 'Group'." #188

@noah-stahl

Description

@noah-stahl

Hi, I'm trying to create a new group, I initialize a GraphServiceClient just like in the README

context = MicrosoftKiotaAuthenticationOAuth::ClientCredentialContext.new(
  TENANT_ID, CLIENT_ID, CLIENT_SECRET
)

authentication_provider = MicrosoftGraphCore::Authentication::OAuthAuthenticationProvider.new(
  context, nil, ['https://graph.microsoft.com/.default']
)

adapter = MicrosoftGraph::GraphRequestAdapter.new(authentication_provider)
@client = MicrosoftGraph::GraphServiceClient.new(adapter)

Then I try to build a Group object and POST it
I pieced this code together by using this doc https://learn.microsoft.com/en-us/graph/api/group-post-groups?view=graph-rest-1.0 as well as another user's code from this issue #163 (comment)

new_group = MicrosoftGraph::Models::Group.new.tap do |group|
  group.display_name = 'My new Group'
  group.mail_enabled = false
  group.mail_nickname = 'newgroup'
  group.security_enabled = true
  group.group_types = ['Unified']
end

@client.groups.post(new_group).resume

But I get an error back with the following message A value is required for property 'displayName' of resource 'Group'.
What am I missing?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions