英文:
How to send messages as replies in 1:1 chat using graph API?
问题
https://graph.microsoft.com/v1.0/chats/{user_id}/messages/{message_id}/replies
response got is given below:
{'error': {'code': 'UnknownError', 'message': '', 'innerError': {'date': '2023-07-12T14:44:27', 'request-id': '4420e38b-29f3-452c-8d2b-d1cb541f6a87', 'client-request-id': '4420e38b-29f3-452c-8d2b-d1cb541f6a87'}}}
I am using delegated access token for these API's and required permissions are added. I am able to send messages in chats, but my requirement is to add messages as replies to previous messages using the message id.
Is there any way to do this using graph API?
英文:
I was trying to send messages as replies in teams using graph API's. In teams channels I was able to send messages using below endpoint.
But in case of 1:1 chats I used below endpoint, and it didn't work.
https://graph.microsoft.com/v1.0/chats/{user_id}/messages/{message_id}/replies
response got is given below:
{'error': {'code': 'UnknownError', 'message': '', 'innerError': {'date': '2023-07-12T14:44:27', 'request-id': '4420e38b-29f3-452c-8d2b-d1cb541f6a87', 'client-request-id': '4420e38b-29f3-452c-8d2b-d1cb541f6a87'}}}
I am using delegated access token for these API's and required permissions are added. I am able to send messages in chats, but my requirement is to add messages as replies to previous messages using the message id.
Is there any way to do this using graph API?
答案1
得分: 0
Teams实际上不支持在一对一聊天中进行“线程化”,这本质上就是对特定消息进行“回复”。当你在个人聊天中点击“回复”按钮时,它只是在主要聊天中创建一种“引用”的文本。这就是为什么你无法访问“/replies”端点,因为它不存在。然而,在频道中是存在的(因此存在线程化对话),这就是为什么该端点对你有效的原因。
英文:
Teams doesn't actually support "threading" in 1-1 chat, which would essentially be "replying" to a specific message. When you click the "reply" button in a personal chat, all it's doing is creating a kind of "quoted" text in the main chat. That's why you can't access the "/replies" endpoint, it doesn't exist. It -does- exist in Channels though (hence threaded conversations), which is why that endpoint is working fine for you.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论