我已经建立了“微软bot框架”和“微软团队渠道”之间的联系。Chat/Web正在按预期进行通信。现在我有了一个HTML页面(下面是代码),这个HTML页面有一个聊天机器人,需要连接到MicrosoftTeams。对于EXample:如果我从HTML页面发送"Hi“消息,这条消息应该到达Microsoft。
HTML代码
<!DOCTYPE html>
<html>
<body>
<iframe id="chat" style="width: 400px; height: 400px;" src=''></iframe>
</body>
<script>
var xhr = new XMLHttpRequest();
xhr.open('GET', "https://webchat.botframework.com/api/tokens", true);
xhr.setRequestHeader('Authorization', 'BotConnector ' + 'vU-0WBkWsO4.Pun532fUbjOmaM-JV4rv0u3rQ982B5B1VR4at5sNar0');
xhr.send();
xhr.onreadystatechange = processRequest;
function processRequest(e) {
console.log("e",e)
if (xhr.readyState == 4 && xhr.status == 200) {
var response = JSON.parse(xhr.responseText);
document.getElementById("chat").src="https://webchat.botframework.com/embed/CLIENT_LENOVO?t="+response
}
}
</script>
</html>https://stackoverflow.com/questions/62340149
复制相似问题