如何通过Power Automate给自己发送消息?已尝试Graph API及构造聊天ID
解决Power Automate给自己发送私聊消息的方案
方案1:使用「向用户发送自适应卡片」动作(最简单)
- 直接在Power Automate中添加「向用户发送自适应卡片」动作
- 收件人选择自己的账号,填写卡片标题和内容即可发送,无需依赖聊天ID,完全规避一对一聊天的限制
方案2:创建专属私有频道/小组
- 在Teams中创建一个只有自己加入的私有小组或频道
- 在Power Automate的「在聊天或频道中发布消息」动作里,选择这个专属频道作为目标,就能实现给自己发消息的效果,还能长期存档消息内容
方案3:用Microsoft Graph API创建并使用自己的聊天ID
- 创建自己的聊天:调用Graph API的POST请求
POST https://graph.microsoft.com/v1.0/chats,请求体如下:
{ "chatType": "oneOnOne", "members": [ { "@odata.type": "#microsoft.graph.aadUserConversationMember", "roles": ["owner"], "user@odata.bind": "https://graph.microsoft.com/v1.0/users('{你的用户ID}')" } ] }
- 成功请求后,响应会返回该聊天的
id字段,把这个ID复制下来 - 在Power Automate中用「在聊天或频道中发布消息」动作,粘贴这个聊天ID即可发送消息
方案4:直接用Graph API发送消息(跳过Power Automate内置动作)
- 在Power Automate中添加「发送HTTP请求」动作,选择Microsoft Graph连接器
- 请求方法选POST,URL填
https://graph.microsoft.com/v1.0/me/chats/{上面创建的聊天ID}/messages - 请求体填写消息内容,示例:
{ "body": { "content": "这是来自Power Automate的测试消息" } }
注意:使用Graph API时需要确保Power Automate的连接账号拥有对应的权限(如Chat.Create、ChatMessage.Send)。
内容的提问来源于stack exchange,提问作者Francesco Maria Falini
相关产品推荐
相关产品推荐

