Problem on add out-of-tenant user to a chat group with GraphApi

Fabio Fornaciari 31 Reputation points
2023-05-31T15:30:45.4433333+00:00

Hi,

I have a problem adding a out-of-tenant user to a chat.
I have follow the documentation at this link
https://learn.microsoft.com/en-us/graph/api/chat-post-members?view=graph-rest-1.0&tabs=http
the example 6 is my case, and I'm able to add a "normal" user or a in-tenant Guest User!
This is the payload body example:

{
    "@odata.type": "#microsoft.graph.aadUserConversationMember",
    "******@odata.bind": "https://graph.microsoft.com/v1.0/users/<out-of-tenant-userId>",
    "roles": [
        "owner"
    ],
    "tenantId": "<tenantId of out-of-tenant userId specified on ******@odata.bind property>"
}

But doing the call I receive this error:

{
    "error": {
        "code": "Forbidden",
        "message": "AclCheckFailed",
        "innerError": {
            "date": "2023-05-31T14:40:32",
            "request-id": "02e6a983-042e-47ff-a518-62779bc82628",
            "client-request-id": 
"74783176-c048-da72-98bc-d3f556cbad54"
        }
    }
}

and if I try to get out-of-tenant user info executing the GET call
https://graph.microsoft.com/v1.0/users/<out-of-tenant-userId>
I receive this error:

{
    "error": {
        "code": "Request_ResourceNotFound",
        "message": "Resource '<out-of-tenant userId>' does not exist or one of its queried reference-property objects are not present.",
        "innerError": {
            "date": "2023-05-31T15:22:17",
            "request-id": "54e7949c-b314-4705-8f81-4632e3b17ea7",
            "client-request-id": "74783176-c048-da72-98bc-d3f556cbad54"
        }
    }
}

Where I'm making a mistake?

There is some configuration on the application settings to permit to get out-of-tenant user info?

Thanks!

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
10,894 questions
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,704 questions
Microsoft Teams Development
Microsoft Teams Development
Microsoft Teams: A Microsoft customizable chat-based workspace.Development: The process of researching, productizing, and refining new or existing technologies.
4,069 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.