使用OutlookClient和Outlook Calendar API发布和删除预订 [英] POST and DELETE a booking using OutlookClient and Outlook Calendar API
问题描述
我正在使用 Outlook-SDK-Android ( Outlook日历REST API .
到目前为止,我已经能够使用以下方法从日历中获取事件:
So far I've been able to get the events from my calendar using:
import com.microsoft.services.outlook.fetchers.OutlookClient;
OutlookClient mClient;
...
mClient = new OutlookClient(outlookBaseUrl, mResolver);
final List<Event> events = mClient
.getMe()
//.getUsers()
//.getById("meetingRoom@company.com") // This gives me back 403 :(
.getCalendarView()
.addParameter("startDateTime", startDate)
.addParameter("endDateTime", endDate)
.read()
(请参见此处).
现在的问题是:
- 如何使用OutlookClient添加预订?
( POST https://outlook.office.com/api/v2.0/me/日历/{calendar_id}/事件-来自
(删除 https://outlook.office.com/api/v2.0/me/事件/{event_id} -来自文档) 谢谢 感谢其中一位Outlook SDK Android作者(Marcos Torres-微软委内瑞拉)的提示, Thanks to the hints received from one of the Outlook SDK Android authors (Marcos Torres - Microsoft Venezuela), it simply is: 创建活动¶
删除事件: 请参见值得牢记的是,我们不再维护SDK.顺便说一下,到4月初(构建大会),将发布一个新的SDK.虽然可能不会涵盖所有的Outlook API,现在,它将是将来." 还有请记住,SDK是通过端点元数据代码生成的.如果元数据(因此服务)发生任何变化,则SDK将无法工作." 这篇关于使用OutlookClient和Outlook Calendar API发布和删除预订的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!推荐答案
Event addedEvent = client.getMe()
.getCalendars().getById("Calendar").getEvents().add(event).get();
client.getMe().getEvents().getById(addedEvent.getId()).delete().get();