Hi Michael Wilcox,
Thank you for contacting Microsoft!
The error 400 with the message "'user@odata.bind' field is missing in the request" typically occurs due to an issue with the format or content of the request being sent.
It seems you might be trying to use {user_email} in the "user@odata.bind" field. Instead, please use the "Id" which can be fetched via the following endpoint: https://graph.microsoft.com/v1.0/users
.
POST https://graph.microsoft.com/v1.0/chats
Content-Type: application/json
{
"chatType": "oneOnOne",
"members": [
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('8b0xxxxx-4792-4def-b2c9-c363a1xxxxxx')"
},
{
"@odata.type": "#microsoft.graph.aadUserConversationMember",
"roles": ["owner"],
"user@odata.bind": "https://graph.microsoft.com/v1.0/users('82axxxxx-f7cc-4a2e-a728-3a5df2xxxxxx')"
}
]
}
For more details on creating a one-on-one chat, please refer to the documentation here:
https://zcusa.951200.xyz/en-us/graph/api/chat-post?view=graph-rest-1.0&tabs=http
Hope this helps.
If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.