0

我正在使用Outlook-SDK-AndroidMS)與​​對話。使用OutlookClient和Outlook日曆API POST和刪除預訂

到目前爲止,我已經能夠使用到從我的日曆事件:

 import com.microsoft.services.outlook.fetchers.OutlookClient; 

     OutlookClient mClient; 
     ... 
     mClient = new OutlookClient(outlookBaseUrl, mResolver); 

     final List<Event> events = mClient 
      .getMe() 
      //.getUsers() 
      //.getById("[email protected]") // This gives me back 403 :(
      .getCalendarView() 
      .addParameter("startDateTime", startDate) 
      .addParameter("endDateTime", endDate) 
      .read() 

(見here)。

現在的問題是:

  • 我如何使用OutlookClient添加預訂?

POSThttps://outlook.office.com/api/v2.0/me/calendars/{calendar_id}/events - 從documentation

  • 怎麼樣刪除日曆事件呢?

DELETEhttps://outlook.office.com/api/v2.0/me/events/{event_id} - 從documentation

感謝

回答

0

由於從Outlook SDK Android的作者(馬科斯托雷斯 - 微軟委內瑞拉)中的一個接收的提示,簡單地說就是:

創建活動:

Event addedEvent = client.getMe() 
         .getCalendars().getById("Calendar").getEvents().add(event).get(); 

刪除事件:

client.getMe().getEvents().getById(addedEvent.getId()).delete().get(); 

e2e test

值得注意的是,雖然「我們不再維護SDK了,順便說一下,到4月初(Build Conference),一個新的SDK將會發布,但現在可能不會覆蓋所有的Outlook API表面,它將在未來。「

還有「請記住SDK是由端點元數據代碼生成的,如果有任何機會改變元數據(因此服務),SDK將無法工作。