0

我正在使用 Outlook-SDK-Android ( https://github.com/OfficeDev/Outlook-SDK-Android ) 与 Outlook 日历 REST API ( https://msdn.microsoft.com/en-us/office/ office365/api/日历休息操作)。

到目前为止,我已经能够使用以下方法在我自己的日历上获取事件:

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

            OutlookClient mClient;
            ...
            mClient = new OutlookClient(outlookBaseUrl, mResolver);
            ...
            mClient.getMe()                
                    .getCalendarView()
                    .addParameter("startDateTime", startDate)
                    .addParameter("endDateTime", endDate)
                    .read()

这对应于“ https://outlook.office.com/api/v2.0/me/calendarView?startDateTime={start_datetime}&endDateTime={end_datetime}

  • 为了将它用于我具有读取权限的其他用户日历,我如何以 Outlook 文档中指定的以下格式实现相同的功能?

" https://outlook.office.com/api/v2.0/USERS/meetingRoom@etc.com/calendars/Calendar/EVENTS?startDateTime={start_datetime}&endDateTime={end_datetime} "

(或“ ..v2.0/USERS/meetingRoom@etc.com/CALENDARVIEW

  • 如何使用 OutlookClient 将查询参数“$select”添加到后者?(例如。$select=主题、组织者、开始、结束)
4

2 回答 2

1

有一个select方法:

public OrcCollectionFetcher<TEntity, TFetcher, TOperations> select(String select)

OrcCollectionFetcher课堂上,所以你可以这样称呼它:

mClient.getMe()                
                    .getCalendarView()
                    .addParameter("startDateTime", startDate)
                    .addParameter("endDateTime", endDate)
                    .select("Subject")
                    .read()

要从资源中获取事件,请尝试以下操作:

            final List<Event> events = outlookClient
                .getUsers()
                .getById("meetingRoom@company.com")
                .getCalendarView()
                .addParameter("startDateTime", startDate)
                .addParameter("endDateTime", endDate)
                .read()
于 2016-03-08T18:35:23.460 回答
0
        mClient.getMe()                
                .getCalendarView()
                .addParameter("startDateTime", startDate)
                .addParameter("endDateTime", endDate)
                .select("Subject,Start,End").
                .read()

请参阅https://msdn.microsoft.com/office/office365/api/complex-types-for-mail-contacts-calendar#UseODataqueryparametersSelectspecificpropertiestobereturned

于 2016-05-18T04:55:48.967 回答