thub.users.profile.tabs.comments.personalized


The payload that was sent to the service sorry. Instead of code, the actual json payload.

Can you share the payload over the wire? It looks like your payload is malformed.

The issue is that there are 2 chats with the same person. One added as guest and second same person as federated user it seems. Let me explain the difference between the two and tell you how to get to the state you want.

Teams supports a bunch of ways to talks to external users. The two in play you see here are

  1. Federation - User must select their home tenant at login

  2. AAD Guest - User must select tenant they are guest in at login

The chat you see where 'External' appears is Federation. The chat where you see 'Guest' appear at the end of the name is AAD guest.

If you want to create federated chat, you need to pass TenantId of the user's home tenant when creating a chat. For AAD guest you just need to specify the ID of the user in your tenant (not the original home tenant of the user). For AAD guest, the user must be invited into the tenant first.

Now as far as sending messages goes, you can send using the chatId you see in the url of Teams client if that is all you are looking for.

Either way based on how they logged in, messages will be delivered to them. They need to switch tenants to receive them though

If you intend to send the message using federation you do not need to invite the user. To create a chat with federated user, you need to specify tenantId, like below. This tenantId needs to be the home tenant of the user who you want to create federated chat with.

POST https://graph.microsoft.com/beta/chats
Content-Type: application/json

{
  "chatType": "oneOnOne",
  "members": [
    {
      "@odata.type": "#microsoft.graph.aadUserConversationMember",
      "roles": ["owner"],
      "user@odata.bind": "https://graph.microsoft.com/beta/users('8b081ef6-4792-4def-b2c9-c363a1bf41d5')"
    },
    {
      "@odata.type": "#microsoft.graph.aadUserConversationMember",
      "roles": ["owner"],
      "user@odata.bind": "https://graph.microsoft.com/beta/users('82af01c5-f7cc-4a2e-a728-3a5df21afd9d')",
      "tenantId": "aa2adf79-44e9-43c2-8f30-d67ae85aee8f"
    }
  ]
}


Regarding switcher, when user logs in into Teams client they should see a picker like below

183703-image.png


image.png (33.1 KiB)

You should know their TenantId. You can try to use their UPN instead, but remember, this needs to be their original UPN not the guest upn in your tenant. Also it needs to be UPN and not email.

It looks like the user might be using Teams consumer to Teams enterprise federation then. How do they open teams? Using teams.microsoft.com or teams.live.com? If it is latter that is Teams for consumer to Teams for enterprise federation which isn't supported through Graph.

What I am trying to know here is if they are using Teams consumer login (as in personal account login). If they are using that, then you can't create chat using Graph yet.

Clarifications

  1. You cannot create a new chat with personal account users.

  2. You CAN send messages to an existing chat regardless of who is on the chat (there are some exception for SFB federation though)

  3. You CAN read a chat regardless of who it's members are

So if all you wanna do is send message it will work yes.


I shared the doc regarding federation. Sharing it again https://docs.microsoft.com/en-us/microsoftteams/native-chat-for-external-users

If it is enterprise teams user yes you can create chat with them provided both organizations have Teams enabled and allow federation (you can try to create the chat and see if you get success of failure with 403).

If you know the UPN of federated user, you can use that too if you dont know tenantId. Again UPN and not email.

Try using https://graph.microsoft.com/beta/users?filter= startswith(mail,'id-GradyA@M365x881152.OnMicrosoft.com') or startswith(userPrincipalName,'id-GradyA@M365x881152.OnMicrosoft.com')

Also are you sure the email starts with id-? That sounds like a typo.

Reactions are not supported in this API at the moment, but it is being worked on.

It is a feature in backlog, nothing to publically track it. The API works as intended today. The feature is looking for enhancements.

For the above error, do you client-request-Id and timestamp when the request was made?

As far as delegated goes, it is supported but not for rich yet.

List channel messages in application context is allowed. Requires protected API access however.

It's the same as any other list channel messages nothing special about it https://docs.microsoft.com/en-us/graph/api/channel-list-messages?view=graph-rest-1.0&tabs=http Similar public channels, this call also requires Protected API access