-->

How can i get the outlook free / busy rest api for

2019-06-10 08:48发布

问题:

I use Microsoft outlook as a client to view my mail .

How can i get the detail for particular user free / busy detail of calendar ?

How can i see the rest api for this ?

I have seen C# code for this and has checked that .

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

But i need REST api for this . I have checked this.

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

How can i implement that in my case ?

Let me know if more information need .

Any hint appreciated . Thanks

回答1:

Ok finally I have solved this issue .

Let me tell you how you can do so .

Two thing you need for this is.

1) Your exchange server url

You can get that by this approach . For exchange server url , credit goes to this URL .

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

I am adding step also

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'

After you have url do this .

2) Send POST text\xml request

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

and the xml body from here

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>

Hope this works for you too .

If any issue ping me . I love to share.