代码之家  ›  专栏  ›  技术社区  ›  Himanshu sharma

如何为我自己的公司电子邮件交换获取outlook忙/闲rest api?

  •  0
  • Himanshu sharma  · 技术社区  · 7 年前

    我使用Microsoft outlook作为客户端来查看我的邮件。

    如何获取日历的特定用户忙/闲详细信息?

    如何查看rest api?

    我已经看到了这方面的C#代码,并对其进行了检查。

    Get appointments from coworker via EWS only with "Free / Busy time, subject, location" permission level

    但我需要REST api来实现这一点。我已经检查过了。

    https://msdn.microsoft.com/en-us/office/office365/api/calendar-rest-operations#FindMeetingTimes

    我如何在我的案例中实现这一点?

    如果需要更多信息,请告诉我。

    感谢您的任何提示。谢谢

    1 回复  |  直到 7 年前
        1
  •  1
  •   Himanshu sharma    7 年前

    好的,我终于解决了这个问题。

    让我告诉你怎么做。

    你需要做的两件事是。

    1) 您的exchange server url

    你可以通过这种方法得到。 对于exchange server url,计入此url。

    https://support.neuxpower.com/hc/en-us/articles/202482832-Determining-the-Exchange-Web-Services-EWS-URL

    我也在添加步骤

    2. Use Microsoft Outlook (2007 and later) that connects to the same Exchange EWS Connector.
    
    Hold the Ctrl key and right click on the Outlook Icon in the system tray
    Select “Test E-mail Auto Configuration” from the menu
    Type in an email address located on the desired Exchange server
    Click Test
    The URL is listed as 'Availability Service URL'
    

    在你有url之后,做这个。

    2) 发送POST text\xml请求

    url地址 https://--your-exchange-url--/EWS/Exchange.asmx

    这里的xml正文

    https://msdn.microsoft.com/en-us/library/office/aa564001(v=exchg.150).aspx

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                   xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
                   xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
      <soap:Body>
        <GetUserAvailabilityRequest xmlns="http://schemas.microsoft.com/exchange/services/2006/messages"
                    xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
          <t:TimeZone xmlns="http://schemas.microsoft.com/exchange/services/2006/types">
            <Bias>480</Bias>
            <StandardTime>
              <Bias>0</Bias>
              <Time>02:00:00</Time>
              <DayOrder>5</DayOrder>
              <Month>10</Month>
              <DayOfWeek>Sunday</DayOfWeek>
            </StandardTime>
            <DaylightTime>
              <Bias>-60</Bias>
              <Time>02:00:00</Time>
              <DayOrder>1</DayOrder>
              <Month>4</Month>
              <DayOfWeek>Sunday</DayOfWeek>
            </DaylightTime>
          </t:TimeZone>
          <MailboxDataArray>
            <t:MailboxData>
              <t:Email>
                <t:Address>user1@example.com</t:Address>
              </t:Email>
              <t:AttendeeType>Required</t:AttendeeType>
              <t:ExcludeConflicts>false</t:ExcludeConflicts>
            </t:MailboxData>
            <t:MailboxData>
              <t:Email>
                <t:Address>user2@example.com</t:Address>
              </t:Email>
              <t:AttendeeType>Required</t:AttendeeType>
              <t:ExcludeConflicts>false</t:ExcludeConflicts>
            </t:MailboxData>
          </MailboxDataArray>
          <t:FreeBusyViewOptions>
            <t:TimeWindow>
              <t:StartTime>2006-10-16T00:00:00</t:StartTime>
              <t:EndTime>2006-10-16T23:59:59</t:EndTime>
            </t:TimeWindow>
            <t:MergedFreeBusyIntervalInMinutes>60</t:MergedFreeBusyIntervalInMinutes>
            <t:RequestedView>DetailedMerged</t:RequestedView>
          </t:FreeBusyViewOptions>
        </GetUserAvailabilityRequest>
      </soap:Body>
    </soap:Envelope>
    

    希望这对你也有用。

    如果有任何问题,请告诉我。我喜欢分享。