使用OutlookClient获取用户日历 [英] Get user calendar using OutlookClient

查看:485
本文介绍了使用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()

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

  • 为了将其用于我已获得阅读权限的其他用户日历,我如何以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?

" 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 = 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆