我是新来这里使用ruby和outlook的,我发现了gem RubyOutlook,它是office365和ruby的包装器。
如何使用RubyOutlook gem创建会议请求?我们是否有相关的帮助文件
发布于 2018-04-07 00:51:13
gem的readme是稀缺的,所以您必须在source code中查找。创建oauth令牌后,如自述文件中所述,您需要使用令牌、事件json有效负载、日历文件夹(nil表示默认日历)和事件所有者的用户的电子邮件来调用create_event
:
require 'ruby_outlook'
outlook_client = RubyOutlook::Client.new
# ...
# create oauth token, as described in the readme
# ...
event_payload =
{
"Subject": "Discuss the Calendar REST API",
"Body": {
"ContentType": "HTML",
"Content": "I think it will meet our requirements!"
},
"Start": {
"DateTime": "2014-02-02T18:00:00",
"TimeZone": "Pacific Standard Time"
},
"End": {
"DateTime": "2014-02-02T19:00:00",
"TimeZone": "Pacific Standard Time"
},
"Attendees": [
{
"EmailAddress": {
"Address": "john@example.com",
"Name": "John Doe"
},
"Type": "Required"
}
]
}
outlook_client.create_event(token, event_payload, nil, 'john@example.com')
用于创建事件的Here's the relevant Outlook API documentation。这就是我获取事件有效负载的地方。
https://stackoverflow.com/questions/49655369
复制相似问题