import { ChatClient, ChatThreadClient } from '@azure/communication-chat';
import { AzureCommunicationTokenCredential } from '@azure/communication-common';
let createChatThreadRequest =
{
topic: 'Preparation for London conference',
participants:
[
{
user: { communicationUserId: '<USER_ID_FOR_JACK>' },
displayName: 'Jack'
},
{
user: { communicationUserId: '<USER_ID_FOR_GEETA>' },
displayName: 'Geeta'
}
]
};
let createChatThreadResponse = await chatClient.createChatThread(createChatThreadRequest);
let threadId = createChatThreadResponse.chatThread.id;
我的 package.json:
"@azure/communication-identity": "1.0.0-beta.4",
"@azure/communication-calling": "1.0.0-beta.6",
"@azure/communication-chat": "1.0.0-beta.4",
"@azure/communication-common": "1.0.0-beta.5",
"@azure/communication-signaling": "1.0.0-beta.2",
最新尝试:
createChatThreadRequest:
{
"topic": "Ghost Frog",
"participants": [
{
"user": {
"communicationUserId": "ey...Ug"
},
"displayName": "frog"
}
]
}
POST 错误 400 https://########.communication.azure.com/chat/threads?api-version=2020-11-01-preview3
RestError: {"error":{"code":"BadRequest","message":"发生了一个或多个验证错误。","details":[{"message":"为 Id 提供的值无效。" ,"目标":"参与者[0].Id"}]}}
错误消息正在寻找名为“Id”的属性。该规范不需要 ID。精氨酸。