无需验证即可获取Office365电子邮件的日历

迪内什·曼恩(Dinesh Manne)

我想获取特定用户的事件列表,比如说使用office365帐户的[email protected][email protected]

我需要在未登录的情况下检索[email protected]日历。我的申请就像列出客户可用的时间安排一样,以便他们可以选择我的空闲时间并安排与我开会的时间。我需要从列表中过滤已经安排好的事件...是否有示例代码可以在不登录的情况下获取日历事件?

我尝试了office365多租户应用程序,该应用程序将提供示例代码,以便仅在登录后获取日历事件。我不需要身份验证就可以了。请帮我。

迪内什·曼恩(Dinesh Manne)

最后,我尝试使用忙/闲代码。我的代码如下...我正在执行此过程,但是我不知道它是否正确。我有一个Microsoft Office 365帐户,并且通过静默传递凭据,正在创建Exchange Server服务。之后,我将按照以下方式传递不同的域参加者信息,如ORGANIZER和REQUIRED。但是,它返回的所有值不会跳过那些用户的任何预定会议。

假设[email protected]是ORGANIZER,而[email protected]是进行会议所必需的。User1的会议安排在每天的7:00-7:30pm进行,但是当我执行以下脚本时,它显示我7:00-7:30pm可以进行会议。它应该阻止那个时间。

您可以建议对代码进行一些更改,我是否以正确的方式进行?

private static void GetSuggestedMeetingTimes(ExchangeService service)
{


    List<AttendeeInfo> attendees = new List<AttendeeInfo>();

    attendees.Add(new AttendeeInfo()
    {
        SmtpAddress = "[email protected]",
        AttendeeType = MeetingAttendeeType.Organizer
    });

    attendees.Add(new AttendeeInfo()
    {
        SmtpAddress = "[email protected]",
        AttendeeType = MeetingAttendeeType.Required
    });

    // Specify options to request free/busy information and suggested meeting times.
    AvailabilityOptions availabilityOptions = new AvailabilityOptions();
    availabilityOptions.GoodSuggestionThreshold = 49;
    availabilityOptions.MaximumNonWorkHoursSuggestionsPerDay = 0;
    availabilityOptions.MaximumSuggestionsPerDay = 40;
    // Note that 60 minutes is the default value for MeetingDuration, but setting it explicitly for demonstration purposes.
    availabilityOptions.MeetingDuration = 30;
    availabilityOptions.MinimumSuggestionQuality = SuggestionQuality.Good;
    availabilityOptions.DetailedSuggestionsWindow = new TimeWindow(DateTime.Now.AddDays(1), DateTime.Now.AddDays(2));
    availabilityOptions.RequestedFreeBusyView = FreeBusyViewType.FreeBusy;

    // Return free/busy information and a set of suggested meeting times. 
    // This method results in a GetUserAvailabilityRequest call to EWS.
    GetUserAvailabilityResults results = service.GetUserAvailability(attendees,
                                                                     availabilityOptions.DetailedSuggestionsWindow,
                                                                     AvailabilityData.FreeBusyAndSuggestions,
                                                                     availabilityOptions);
    // Display suggested meeting times. 
    Console.WriteLine("Availability for {0} and {1}", attendees[0].SmtpAddress, attendees[1].SmtpAddress);
    Console.WriteLine();

    foreach (Suggestion suggestion in results.Suggestions)
    {
        Console.WriteLine("Suggested date: {0}\n", suggestion.Date.ToShortDateString());
        Console.WriteLine("Suggested meeting times:\n");
        foreach (TimeSuggestion timeSuggestion in suggestion.TimeSuggestions)
        {
            Console.WriteLine("\t{0} - {1}\n",
                              timeSuggestion.MeetingTime.ToShortTimeString(),
                              timeSuggestion.MeetingTime.Add(TimeSpan.FromMinutes(availabilityOptions.MeetingDuration)).ToShortTimeString());



        }
    }

    int i = 0;

    // Display free/busy times.
    foreach (AttendeeAvailability availability in results.AttendeesAvailability)
    {
        Console.WriteLine("Availability information for {0}:\n", attendees[i].SmtpAddress);

        foreach (CalendarEvent calEvent in availability.CalendarEvents)
        {
            Console.WriteLine("\tBusy from {0} to {1} \n", calEvent.StartTime.ToString(), calEvent.EndTime.ToString());
        }

        i++;
    }

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

office365 的 SMTP 电子邮件

无需验证电子邮件即可认知

Office365 API:使用oauth2令牌获取当前用户的电子邮件吗?

Jenkins和Office365电子邮件通知设置

用户无需验证电子邮件即可登录(Swift,Firebase)

Office365 API根据发件人的电子邮件地址附加电子邮件签名

Office365 / MS Outlook电子邮件地址变体

C#使用Office365 SMTP发送电子邮件

如何使用Office365转发某些电子邮件

使用laravel中集成的Office365发送电子邮件

我可以通过Office365共享邮箱发送SMTP电子邮件吗?

Office365连接器:没有电子邮件地址的名称

通过Office365 smtp使用nodemailer发送电子邮件时出错(MEANjs支架)

EWS托管的Api-从Office365交换服务器检索电子邮件

Django:通过Office365发送电子邮件

使用 tls/ssl 使用 python 为 office365 发送 SMTP 电子邮件

如何使用Office365 API v2搜索从授权帐户发送的电子邮件?

通过 CLI 以“公司模式”从 office365 下载电子邮件

AWS Lambda 无需验证即可发送电子邮件

Firebase身份验证服务-无需登录即可从电子邮件中查找uid

当新电子邮件到达 Office365 时,Outlook 插件中是否有任何事件

使用.Net C#IMAP客户端从Exchange Server阅读Office365电子邮件

使用Oauth2通过Office365 C#发送电子邮件

使用 EWS 从 Office365 发送电子邮件且发件人地址不存在

Office 365高级威胁防护正在标记我的Firebase身份验证电子邮件

无需使用 Firebase 即可使用电子邮件和密码进行 Flutter 身份验证

使用邮递员发送电子邮件(Office 365),而无需从浏览器登录

从 Wcf Windows 服务发送 Office 365 电子邮件

无法使用Office 365 REST API登录电子邮件