POST 并使用 OutlookClient 和 Outlook 日历删除预订 API
POST and DELETE a booking using OutlookClient and Outlook Calendar API
我正在使用 Outlook-SDK-Android (MS) to talk with Outlook Calendar REST API。
到目前为止,我已经能够使用以下方法从我的日历中获取事件:
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/calendars/{calendar_id}/events - from documentation)
- 改为删除日历事件怎么样?
( 删除 https://outlook.office.com/api/v2.0/me/events/{event_id} - from documentation )
谢谢
感谢一位 Outlook SDK Android 作者(Marcos Torres - Microsoft Venezuela)提供的提示,它只是:
创建活动 :
Event addedEvent = client.getMe()
.getCalendars().getById("Calendar").getEvents().add(event).get();
删除事件 :
client.getMe().getEvents().getById(addedEvent.getId()).delete().get();
见e2e test。
值得注意的是 "We're not maintaining the SDK anymore. By the way, by early April (Build Conference) a new SDK will be released. While may not be covering all the Outlook API surface now, it will be in the future."
还有"Keep in mind the SDK was code-generated from the endpoint-metadata. If by any chance the metadata (hence the service) change, the SDK won't work."
我正在使用 Outlook-SDK-Android (MS) to talk with Outlook Calendar REST API。
到目前为止,我已经能够使用以下方法从我的日历中获取事件:
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/calendars/{calendar_id}/events - from documentation)
- 改为删除日历事件怎么样?
( 删除 https://outlook.office.com/api/v2.0/me/events/{event_id} - from documentation )
谢谢
感谢一位 Outlook SDK Android 作者(Marcos Torres - Microsoft Venezuela)提供的提示,它只是:
创建活动 :
Event addedEvent = client.getMe()
.getCalendars().getById("Calendar").getEvents().add(event).get();
删除事件 :
client.getMe().getEvents().getById(addedEvent.getId()).delete().get();
见e2e test。
值得注意的是 "We're not maintaining the SDK anymore. By the way, by early April (Build Conference) a new SDK will be released. While may not be covering all the Outlook API surface now, it will be in the future."
还有"Keep in mind the SDK was code-generated from the endpoint-metadata. If by any chance the metadata (hence the service) change, the SDK won't work."