使用OutlookClient获取用户日历 [英] Get user calendar using OutlookClient
问题描述
我正在使用Outlook-SDK-Android( https://github.com/OfficeDev/Outlook-SDK-Android )与Outlook Calendar REST API( https://msdn.microsoft.com/en-us/office/office365/api/calendar-rest-operations ).
I'm using Outlook-SDK-Android (https://github.com/OfficeDev/Outlook-SDK-Android) to talk with Outlook Calendar REST API (https://msdn.microsoft.com/en-us/office/office365/api/calendar-rest-operations).
到目前为止,我已经能够使用以下方法在自己的日历上获取事件:
So far I've been able to get the events on my own calendar using:
import com.microsoft.services.outlook.fetchers.OutlookClient;
OutlookClient mClient;
...
mClient = new OutlookClient(outlookBaseUrl, mResolver);
...
mClient.getMe()
.getCalendarView()
.addParameter("startDateTime", startDate)
.addParameter("endDateTime", endDate)
.read()
- 为了将其用于我已获得阅读权限的其他用户日历,我如何以Outlook文档中指定的以下格式实现相同的功能?
- In order to use it for other users calendars on which I have read permission how do I achieve the same in the following format specified in the Outlook documentation?
(或" ..v2.0/USERS/meetingRoom @ etc.com/CALENDARVIEW )
- 如何使用OutlookClient将查询参数"$ select"添加到后者中? (例如,$ select = Subject,Organizer,Start,End)
推荐答案
有一个select
方法:
public OrcCollectionFetcher<TEntity, TFetcher, TOperations> select(String select)
public OrcCollectionFetcher<TEntity, TFetcher, TOperations> select(String select)
在OrcCollectionFetcher
类中,因此您可以这样称呼它:
in OrcCollectionFetcher
class, so you can call it like this:
mClient.getMe()
.getCalendarView()
.addParameter("startDateTime", startDate)
.addParameter("endDateTime", endDate)
.select("Subject")
.read()
要从资源获取事件,请尝试以下操作:
To get events from resource try this:
final List<Event> events = outlookClient
.getUsers()
.getById("meetingRoom@company.com")
.getCalendarView()
.addParameter("startDateTime", startDate)
.addParameter("endDateTime", endDate)
.read()
这篇关于使用OutlookClient获取用户日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!