Forum Discussion
Issue with Teams 'Add a User to Group Chat' API call?
Hello AutomatonSolutionsRDE,
The request fails due to two issues: first, the @odata.type value was misspelled, causing Microsoft Graph to stop processing and return a misleading schema error. Second, an incorrect property was used instead of user@odata.bind. Correcting both issues resolves the problem. The proper request body must include the correct @odata.type, roles array, and the user@odata.bind reference to the target user.
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": [],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('USER_ID')"
}
Sayali, this is not correct. There's nothing wrong with my API call, it's following the exact format you would expect. You are looking at artifacts of my copy/paste, but the API call follows the exact format in the documentation.
https://graph.microsoft.com/v1.0/chats/[[THREAD_ID]]/members
BODY:
{
"chatType": "group",
"\u0040odata.type": "#microsoft.graph.aadUserConversationMember",
"user\u0040odata.bind": "https://graph.microsoft.com/v1.0/users/[[USER_ID]]",
"roles": []
}