question

TerryMatula-6253 avatar image
1 Vote"
TerryMatula-6253 asked TerryMatula-6253 commented

How do you add a Guest user to a Teams group chat?

  1. I tried to create a chat with the logged-in user, a normal Teams users, and a "guest" user: https://docs.microsoft.com/en-us/graph/api/chat-post?view=graph-rest-1.0&tabs=http
    That worked, except it didn't have the guest user in the chat.

  2. I tried adding the guest user: https://docs.microsoft.com/en-us/graph/api/chat-post-members?view=graph-rest-1.0&tabs=http
    But I get this error:

    "code": "Forbidden",
    "message": "AclCheckFailed"



  3. I noticed that existing chats with a guest user have their "role" as "guest", so I attempted the same API but changing their role. And I get this error:

    "code": "BadRequest",
    "message": "The passed-in role must be 'owner'."



Is there a way, using the Grapi API, to add a guest user to a Teams group chat?

microsoft-graph-teamwork
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RamjotSingh avatar image
0 Votes"
RamjotSingh answered TerryMatula-6253 commented

AAD users can only be owners in chat.

· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

If I create a group chat in the Teams client, using my guest account, then access the member list from the Graph API, the guest user has the role "guest". Here's the response:

  "roles": [
                  "guest"
   ]

If I create a "oneOnOne" chat, using the guest user, and then get a member list, the guest user has the role "owner".

There is some inconsistency between group and oneOnOne chats and guest users' roles. How can I make the role "guest" for a guest user in a group chat, using the Graph API?

0 Votes 0 ·

I've verified member role for below 4 scenarios using Teams Client.

a. 1:1 with Active Member of Team
b. Group conversation with 2 other active members of the team
c. 1:1 with another guest user
d. 1:1 with active member user and adding guest user to the chat

For both chat a and chat b, guest user was assigned as "guest" role and other active members were assigned as "owner" role.
For chat c, both guest users appear to be assigned "guest" role, not sure if this is expected.
For chat d, adding guest user to the chat results in new group chat with both users (active member and guest). AAD member is assigned with owner role, where other two guest users are assigned with "Guest" role.

I've also tried to create chat/group chat with guest user in tenant, but it failed to create chat, because the guest user was not AAD member of the tenant.

It would be helpful to investigate further if you could provide which tenant you are trying to create the chat using which users.

My suggestion from above client behavior is that, instead of trying to add a user to existing oneOnOne chat, try creating a brand new group chat including the guest user you are trying to add.

0 Votes 0 ·

Thanks @EvanPark-1588
If I try to create a group chat over the graph API, I always get an error when trying to include a guest user. Both when I try to create it with a guest user in the membership, and also when I try to add a guest user after the group chat was created. The guest user shows up in Azure's User list, and I'm able to add them using the Teams client... just not over the graph api.

Over the Graph API, I tried using the guest user's access token to create a group chat, and received a "AclCheckFailed" error.
And when using a full Member's token, when adding a guest user over the API, I get a "The passed-in role must be 'owner'" error... but I'm not able to change that value.

Since the Graph API membership list shows guest users with the role of "guest", my assumption is that would be the same when creating the group chat over the API. But there does not seem to be a way to a guest users to a group chat over the API.

0 Votes 0 ·