How to add users in the teams chat via integration

Certified Lead Developer

have created the teams chat via integration, so have added the details like tenant id, client id, client secret under connected systems, and then used it under integration and created the new group chat, and i was trying to add users under user info, but when i tried to add, its not working, chat group is created but users are not being added, so can you please let me know, how to add users via integration to the newly created chat group.

adding users under user info- {

{
userName:"abc@yexle.com",
role:"guest",

},

{
userName:"xyz@yexle.com",
role:"guest",

},

}

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    Don't know if this will work, I combined Example #2 (group chat) and #3 (using the userprincipalName in lieu of the uuid)

    learn.microsoft.com/.../chat-post

    {
      "chatType": "group",
      "topic": "Group chat title",
      "members": [
        {
          "@odata.type": "#microsoft.graph.aadUserConversationMember",
          "roles": ["owner"],
          "user@odata.bind": "https://graph.microsoft.com/v1.0/users('jacob@contoso.com')"
        },
        {
          "@odata.type": "#microsoft.graph.aadUserConversationMember",
          "roles": ["owner"],
          "user@odata.bind": "https://graph.microsoft.com/v1.0/users('alex@contoso.com')"
        }
      ]
    }

    If you want to add members to an already existing group chat, you should use the addMembers endpoint.

    learn.microsoft.com/.../chat-post-members

    {
        "@odata.type": "#microsoft.graph.aadUserConversationMember",
        "user@odata.bind": "https://graph.microsoft.com/v1.0/users('jacob@contoso.com')"
        "roles": ["owner"]
    }