跳转到内容

Microsoft Outlook 集成

让你的智能体访问和管理 Outlook 邮件、日历事件和联系人。借助 AI 自动化,你可以发送邮件、检索消息、管理日历事件并组织联系人。

在使用 Microsoft Outlook 集成之前,请确保你已具备:

  • 一个拥有有效订阅的 CrewAI AMP 账户
  • 一个拥有 Outlook 访问权限的 Microsoft 账户
  • 通过 集成页面 连接了你的 Microsoft 账户
  1. 访问 CrewAI AMP Integrations
  2. 在 Authentication Integrations 部分找到 Microsoft Outlook
  3. 点击 Connect 并完成 OAuth 流程
  4. 授予邮件、日历和联系人访问所需权限
  5. Integration Settings 复制你的 Enterprise Token
Terminal window
uv add crewai-tools
Terminal window
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"

或者将其添加到你的 .env 文件中:

CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
microsoft_outlook/get_messages

说明: 获取用户邮箱中的邮件消息。

参数:

  • top (integer, optional): 要检索的消息数(最大 1000)。默认值为 10
  • filter (string, optional): OData 过滤表达式(例如:isRead eq false)。
  • search (string, optional): 搜索查询字符串。
  • orderby (string, optional): 排序字段(例如:receivedDateTime desc)。默认值为 receivedDateTime desc
  • select (string, optional): 选择要返回的特定属性。
  • expand (string, optional): 内联展开相关资源。
microsoft_outlook/send_email

说明: 发送电子邮件。

参数:

  • to_recipients (array, required): 收件人邮箱地址数组。
  • cc_recipients (array, optional): 抄送邮箱地址数组。
  • bcc_recipients (array, optional): 密送邮箱地址数组。
  • subject (string, required): 邮件主题。
  • body (string, required): 邮件正文内容。
  • body_type (string, optional): 正文内容类型。枚举值:TextHTML。默认值为 HTML
  • importance (string, optional): 邮件重要性级别。枚举值:lownormalhigh。默认值为 normal
  • reply_to (array, optional): 回复地址数组。
  • save_to_sent_items (boolean, optional): 是否将邮件保存到已发送文件夹。默认值为 true
microsoft_outlook/get_calendar_events

说明: 获取用户日历中的事件。

参数:

  • top (integer, optional): 要检索的事件数(最大 1000)。默认值为 10
  • skip (integer, optional): 要跳过的事件数。默认值为 0
  • filter (string, optional): OData 过滤表达式(例如:start/dateTime ge '2024-01-01T00:00:00Z')。
  • orderby (string, optional): 排序字段(例如:start/dateTime asc)。默认值为 start/dateTime asc
microsoft_outlook/create_calendar_event

说明: 创建一个新的日历事件。

参数:

  • subject (string, required): 事件主题/标题。
  • body (string, optional): 事件正文/描述。
  • start_datetime (string, required): ISO 8601 格式的开始日期和时间(例如:2024-01-20T10:00:00)。
  • end_datetime (string, required): ISO 8601 格式的结束日期和时间。
  • timezone (string, optional): 时区(例如:Pacific Standard Time)。默认值为 UTC
  • location (string, optional): 事件地点。
  • attendees (array, optional): 参与者邮箱地址数组。
microsoft_outlook/get_contacts

说明: 获取用户通讯录中的联系人。

参数:

  • top (integer, optional): 要检索的联系人数(最大 1000)。默认值为 10
  • skip (integer, optional): 要跳过的联系人数。默认值为 0
  • filter (string, optional): OData 过滤表达式。
  • orderby (string, optional): 排序字段(例如:displayName asc)。默认值为 displayName asc
microsoft_outlook/create_contact

说明: 在用户通讯录中创建一个新联系人。

参数:

  • displayName (string, required): 联系人显示名称。
  • givenName (string, optional): 联系人名字。
  • surname (string, optional): 联系人姓氏。
  • emailAddresses (array, optional): 邮箱地址数组。每一项都是包含 address (string) 和 name (string) 的对象。
  • businessPhones (array, optional): 办公电话号码数组。
  • homePhones (array, optional): 家庭电话号码数组。
  • jobTitle (string, optional): 联系人职务。
  • companyName (string, optional): 联系人公司名称。
microsoft_outlook/get_message

说明: 通过 ID 获取某封特定邮件。

参数:

  • message_id (string, required): 消息的唯一标识符。可通过 get_messages 操作获取。
  • select (string, optional): 以逗号分隔的要返回属性列表。示例:id,subject,body,from,receivedDateTime。默认值为 id,subject,body,from,toRecipients,receivedDateTime
microsoft_outlook/reply_to_email

说明: 回复一封邮件。

参数:

  • message_id (string, required): 要回复的消息唯一标识符。可通过 get_messages 操作获取。
  • comment (string, required): 回复内容。可为纯文本或 HTML。原始邮件会引用在此内容下方。
microsoft_outlook/forward_email

说明: 转发一封邮件。

参数:

  • message_id (string, required): 要转发的消息唯一标识符。可通过 get_messages 操作获取。
  • to_recipients (array, required): 转发收件人邮箱地址数组。示例:[[email protected], [email protected]]。
  • comment (string, optional): 要包含在转发内容上方的可选消息。可为纯文本或 HTML。
microsoft_outlook/mark_message_read

说明: 将消息标记为已读或未读。

参数:

  • message_id (string, required): 消息的唯一标识符。可通过 get_messages 操作获取。
  • is_read (boolean, required): 设置为 true 表示已读,false 表示未读。
microsoft_outlook/delete_message

说明: 删除一封邮件。

参数:

  • message_id (string, required): 要删除的消息唯一标识符。可通过 get_messages 操作获取。
microsoft_outlook/update_event

说明: 更新现有的日历事件。

参数:

  • event_id (string, required): 事件的唯一标识符。可通过 get_calendar_events 操作获取。
  • subject (string, optional): 事件的新主题/标题。
  • start_time (string, optional): ISO 8601 格式的新开始时间(例如:2024-01-20T10:00:00)。要求:使用此字段时还必须提供 start_timezone。
  • start_timezone (string, optional): 开始时间的时区。更新 start_time 时必填。示例:Pacific Standard TimeEastern Standard TimeUTC
  • end_time (string, optional): ISO 8601 格式的新结束时间。要求:使用此字段时还必须提供 end_timezone。
  • end_timezone (string, optional): 结束时间的时区。更新 end_time 时必填。示例:Pacific Standard TimeEastern Standard TimeUTC
  • location (string, optional): 事件的新地点。
  • body (string, optional): 事件的新正文/描述。支持 HTML 格式。
microsoft_outlook/delete_event

说明: 删除一个日历事件。

参数:

  • event_id (string, required): 要删除的事件唯一标识符。可通过 get_calendar_events 操作获取。