Giter VIP home page Giter VIP logo

ews-javascript-api's People

Contributors

benyanke avatar bijection avatar craigmarvelley avatar dependabot[bot] avatar gautamsi avatar inkirby avatar klinki avatar liyinsg avatar nicholas-l avatar snollygolly avatar thlee927 avatar tobiasviehweger avatar zmathew avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ews-javascript-api's Issues

Fetch Contacts and Create Meetings not implemented

Hi Gautam,

I am trying to fetch contact but I did not find any method to achieve this. I think its not yet implemented. Also, for creating new meeting using Appointment.Save I am not able to add RequiredAttendees & OptionalAttendees. Is there any other way to create new meeting? If not then Any plans to implement both these functionalities?

Problem Import eml into Exchange 2013

When I try to import an .eml file I get the following error:
[xmldom error] element parse error: Error: invalid tagName:[email protected]
@#[line:6,col:14]
[xmldom error] element parse error: Error: invalid tagName:[email protected]
@#[line:13,col:6]
[xmldom error] element parse error: Error: invalid tagName:[email protected]
@#[line:19,col:33]
[xmldom error] element parse error: Error: invalid tagName:[email protected]
@#[line:25,col:6]
[xmldom error] element parse error: Error: invalid tagName:[email protected]
@#[line:27,col:13]
[xmldom error] element parse error: Error: invalid tagName:CAJGmDoE-Uc8LfFrVg8ryuOu95kzH4TVSMPSkr+hvpL_9sObJ7w@mail.domain.com
@#[line:54,col:13]
[xmldom error] element parse error: Error: invalid tagName:[email protected]
@#[line:56,col:22]
[xmldom error] element parse error: Error: invalid tagName:[email protected]
@#[line:57,col:32]
[xmldom warning] unclosed xml attribute
@#[line:64,col:23]

My js code is:
fs.open("/tmp/test.eml",'r', function(err, fd) {
fs.stat("/tmp/test.eml", function(err, stats)
{

var bufferSize=stats.size,
  chunkSize=512,
  buffer=new Buffer(bufferSize),
  bytesRead = 0;

while (bytesRead < bufferSize)
{
  if ((bytesRead + chunkSize) > bufferSize)
  {
    chunkSize = (bufferSize - bytesRead);
  }
  fs.read(fd, buffer, bytesRead, chunkSize, bytesRead);
  bytesRead += chunkSize;
}

var email = new ews.EmailMessage(exch);
email.MimeContent = new ews.MimeContent("UTF-8", buffer);
var PR_MESSAGE_FLAGS_msgflag_read = new ews.ExtendedPropertyDefinition(3591, ews.MapiPropertyType.Integer);
email.SetExtendedProperty(PR_MESSAGE_FLAGS_msgflag_read, 1);
email.Save(ews.WellKnownFolderName.Inbox);
console.log(buffer.toString('utf8', 0, bufferSize));
fs.close(fd);

});
});

Can someone help me?
Best Regards
Giovanni

readMe information is wrong

readMe does not show the correct npm install title.

Shows:
npm install ews-managed-api

Should show:
npm install ews-javascript-api

Implement: Conversation operations

ExchangeService methods:

  • FindConversation
  • FindGroupConversation
  • GetConversationItems
  • GetGroupConversationItems
  • EnableAlwaysCategorizeItemsInConversations
  • DisableAlwaysCategorizeItemsInConversations
  • EnableAlwaysDeleteItemsInConversations
  • DisableAlwaysDeleteItemsInConversations
  • EnableAlwaysMoveItemsInConversations
  • DisableAlwaysMoveItemsInConversations
  • MoveItemsInConversations
  • CopyItemsInConversations
  • DeleteItemsInConversations
  • SetReadStateForItemsInConversations
  • SetRetentionPolicyForItemsInConversations
  • SetFlagStatusForItemsInConversations

Feature: AccountLockout detection

to track Implementation of ProcessHttpErrorResponse on ExchangeService which provides Account LockOut detection based on HTTP status code.

part of #28

Implement: eDiscovery/Compliance operations

ExchangeService methods:

  • GetDiscoverySearchConfiguration
  • GetSearchableMailboxes
  • SearchMailboxes
  • SetHoldOnMailboxes
  • GetHoldOnMailboxes
  • GetNonIndexableItemDetails
  • GetNonIndexableItemStatistics

Streaming Notications

Is it possible to have streaming notifications? would like to be able to subscribe to new mail notifications.

error 401

I'm not sure what the issue is, but I get a 401 error when I call GetUserAvailability (I didn't use the autodiscover function). Could this be a problem with authentication on the server side?
Here is the code:

var ews = require('ews-javascript-api');

var exch = new ews.ExchangeService(ews.ExchangeVersion.Exchange2010);
exch.Credentials = new ews.ExchangeCredentials("xxxxx", "xxxxxxxx", "webmail.xxxx.be");
exch.Url = new ews.Uri("https://webmail.xxxx.be/Ews/Exchange.asmx");

var attendee =[new ews.AttendeeInfo("[email protected]")];
var timeWindow = new ews.TimeWindow(ews.DateTime.Now, new ews.DateTime(ews.DateTime.Now.TotalMilliSeconds + ews.TimeSpan.FromHours(48).asMilliseconds()));

exch.GetUserAvailability(attendee, timeWindow, ews.AvailabilityData.FreeBusyAndSuggestions).then(function (availabilityResponse) {
    console.log("succes");
  }, function (errors) {
    console.log(errors);
  });

and here is the error:

[ServiceObjectPropertyDefinition.ctor] uri is null or empty
[ServiceObjectPropertyDefinition.ctor] uri is null or empty
[ServiceObjectPropertyDefinition.ctor] uri is null or empty
[ServiceObjectPropertyDefinition.ctor] uri is null or empty
sending ews request
{ url: 'https://webmail.xxxx.be/Ews/Exchange.asmx',
  headers: 
   { 'Content-Type': 'text/xml; charset=utf-8',
     Accept: 'text/xml',
     Authorization: 'Basic dmVya2xxxxxxxxxxXXvMQ==' },
  type: 'POST',
  data: '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><soap:Header><t:RequestServerVersion xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" Version="Exchange2010"></t:RequestServerVersion><t:TimeZoneContext xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><t:TimeZoneDefinition xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" Name="UTC" Id="UTC"></t:TimeZoneDefinition></t:TimeZoneContext></soap:Header><soap:Body><m:GetUserAvailabilityRequest xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"><m:MailboxDataArray xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"><t:MailboxData xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><t:Email xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><t:Address xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">[email protected]</t:Address></t:Email><t:AttendeeType xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">Required</t:AttendeeType><t:ExcludeConflicts xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">false</t:ExcludeConflicts></t:MailboxData></m:MailboxDataArray><t:FreeBusyViewOptions xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><t:TimeWindow xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><t:StartTime xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">2016-03-14T00:00:00</t:StartTime><t:EndTime xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">2016-03-16T00:00:00</t:EndTime></t:TimeWindow><t:MergedFreeBusyIntervalInMinutes xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">30</t:MergedFreeBusyIntervalInMinutes><t:RequestedView xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">Detailed</t:RequestedView></t:FreeBusyViewOptions><t:SuggestionsViewOptions xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><t:GoodThreshold xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">25</t:GoodThreshold><t:MaximumResultsByDay xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">10</t:MaximumResultsByDay><t:MaximumNonWorkHourResultsByDay xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">0</t:MaximumNonWorkHourResultsByDay><t:MeetingDurationInMinutes xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">60</t:MeetingDurationInMinutes><t:MinimumSuggestionQuality xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">Fair</t:MinimumSuggestionQuality><t:DetailedSuggestionsWindow xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><t:StartTime xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">2016-03-14T00:00:00</t:StartTime><t:EndTime xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">2016-03-16T00:00:00</t:EndTime></t:DetailedSuggestionsWindow></t:SuggestionsViewOptions></m:GetUserAvailabilityRequest></soap:Body></soap:Envelope>' }
Error in calling service, error code:401

Typings for NPM Packages

Hello,

Looking at the Typescript documentation, it seems that your project lacks of an index.d.ts file or of a typings property in your package.json. See http://www.typescriptlang.org/docs/handbook/typings-for-npm-packages.html

When I try to set the typings with "typings": "./typings/ExchangeWebService.d.ts", I get this error

node_modules/ews-javascript-api/typings/ExchangeWebService.d.ts(11133,34): error TS2304: Cannot find name 'UpdateInboxRulesResponse'

Is it an issue or I'm doing that wrong ?

Thanks!

Work in progress, help/suggestion wanted

I have made progress on many items but did not have time to document them. most updates are in dev branch with version pushed out to npm. I am also working on another app (gautamsi/MailboxApp.js - based on electron by @atom) which would showcase what is possible with ews-javascript-api. very slow progress though.

Please feel free to guide me for better documentation strategy (API docs generation etc.).

I have started adding jsdoc comment to new files by copying them from original ews-managed-api source file. Most function signature is same hence it is easier in using them directly. Original c# code has xml comment, I have used xmltojsdoc by @patik. I did modify his demo page at http://patik.github.io/xmltojsdoc/ to http://gautamsi.github.io/xmltojsdoc/indexAuto.html, benefit? added macro to perform paste, convert and then copy to clipboard so that workflow is like

  1. copy xml doc in visual studio (or any editor)
  2. switch to my indexAuto.html
  3. paste in ts file

now I am looking to build API pages any suggestion to generate .md page based on jsdoc comments? I can then modify samples in the page for everyone to use.

any takers for MailboxApp.js frontend? meaning if you can help with creating a nice GUI (ref github.com/nylas/N1), I can plugin ews-javascript-api to talk to Exchange/Office365. If anyone can help with an n1 plugin modal where data can be stored locally in sqlite, (no sync-server needed), this repo can be used to sync,update mailbox using EWS (only for Exchange/O365 mailboxes).

NTLM/ntlmXHR using impersonation

Hey, I'm trying to use impersonation to get users tasks in exchange.
Is it possible with this API?

This (https://gist.github.com/maccyber/a57e3b7f8ded3d72205c817cf4c5b377) code, gives:

Error: Id property must be set before serialization
    at ImpersonatedUserId.WriteToXml (/home/jonas/projects/ews-tasks-exchange/node_modules/ews-javascript-api/js/Misc/ImpersonatedUserId.js:16:19)
    at FindItemRequest.ServiceRequestBase.WriteToXml (/home/jonas/projects/ews-tasks-exchange/node_modules/ews-javascript-api/js/Core/Requests/ServiceRequestBase.js:402:45)
    at FindItemRequest.ServiceRequestBase.EmitRequest (/home/jonas/projects/ews-tasks-exchange/node_modules/ews-javascript-api/js/Core/Requests/ServiceRequestBase.js:102:18)
    at FindItemRequest.ServiceRequestBase.BuildXHR (/home/jonas/projects/ews-tasks-exchange/node_modules/ews-javascript-api/js/Core/Requests/ServiceRequestBase.js:73:14)
    at /home/jonas/projects/ews-tasks-exchange/node_modules/ews-javascript-api/js/Core/Requests/SimpleServiceRequestBase.js:41:33
    at new Promise (/home/jonas/projects/ews-tasks-exchange/node_modules/winjs-node/src/js/WinJS/Promise/_StateMachine.js:988:13)
    at WinJSPromiseApi.create (/home/jonas/projects/ews-tasks-exchange/node_modules/ews-javascript-api/js/Promise_WinJS.js:12:16)
    at Function.PromiseFactory.create (/home/jonas/projects/ews-tasks-exchange/node_modules/ews-javascript-api/js/PromiseFactory.js:32:30)
    at FindItemRequest.SimpleServiceRequestBase.InternalExecute (/home/jonas/projects/ews-tasks-exchange/node_modules/ews-javascript-api/js/Core/Requests/SimpleServiceRequestBase.js:40:48)
    at /home/jonas/projects/ews-tasks-exchange/node_modules/ews-javascript-api/js/Core/Requests/MultiResponseServiceRequest.js:36:19

ReferenceError: Reflect is not defined

Hi,

I am using Nodejs v5.9.1 and ews-javascript-api and getting error

ReferenceError: Reflect is not defined

while executing var ews = require('ews-javascript-api'); code.

I have attached screen shot of the issue. Any help would be highly appreciated.

Thanks,
Alka Saini
error

Calendar Details always return objects busyType ="busy"

Hi,

First of all I want to say thanks for the great module.I am implementing outlook dashboard which lists out meeting rooms that are available and booked.When i make a call to "GetUserAvailability" which always returns Calendar Details that has only busyType="busy" . I think i am missing some thing or configuration is incorrect. Here is code I am using

var exch = new ews.ExchangeService(ews.ExchangeVersion.Exchange2010);
exch.Credentials = new ews.ExchangeCredentials("****", "**");
exch.Url = new ews.Uri("https://colarnexch02.test.com/ews/exchange.asmx");
var attendee = [new ews.AttendeeInfo("
*********************")];
var timeWindow = new ews.TimeWindow(ews.DateTime.Now, new ews.DateTime(ews.DateTime.Now.TotalMilliSeconds +ews.TimeSpan.FromHours(24).asMilliseconds()));

exch.GetUserAvailability(attendee, timeWindow, ews.AvailabilityData.FreeBusy)

This is output i get :

GetUserAvailabilityResponse:
{ FreeBusyResponseArray:
{ FreeBusyResponse:
{ ResponseMessage: { ResponseClass: 'Success', ResponseCode: 'NoError' },
FreeBusyView:
{ FreeBusyViewType: 'Detailed',
CalendarEventArray:
{ __type: 'CalendarEventArray',
CalendarEvent:
[ { __type: 'CalendarEvent',
StartTime: '2016-03-01T14:30:00',
EndTime: '2016-03-01T15:00:00',
BusyType: 'Busy',
CalendarEventDetails:
{ __type: 'CalendarEventDetails',
ID: '00000000AB34FCBB2DD5D5439F00576C34BC890F0700A7104A6AE99E604A9316B97E9A390B880000003168AF0000A7104A6AE99E604A9316B97E9A390B880000007B4ED50000',
Subject: 'Dave Adam',
Location: '***********************',
IsMeeting: 'true',
IsRecurring: 'true',
IsException: 'false',
IsReminderSet: 'false',
IsPrivate: 'false' } },

Thanks in Advance.

ConversationIndex Inaccessible in 2007

See these two stackoverflow posts:
http://stackoverflow.com/questions/24490464/conversationid-property-vs-conversationindex-property-in-exchange-web-services-m
http://stackoverflow.com/questions/7487570/implementing-outlook-2010s-group-by-conversation-using-ews-and-exchange-2007

Try this in the console:

> new ews.ExtendedPropertyDefinition(ews.EmailMessageSchema.ConversationIndex, ews.MapiPropertyType.Binary)
[ByteArrayPropertyDefinition.Parse] ByteArrayPropertyDefinition needs to be improved
Error: ByteArrayPropertyDefinition: incorrect call of ToString(value): value is undefined
    at ByteArrayPropertyDefinition.ToString (/Users/demi/git/ecma/switchedon/sync/node_modules/ews-javascript-api/js/PropertyDefinitions/ByteArrayPropertyDefinition.js:64:15)
    at ByteArrayPropertyDefinition.TypedPropertyDefinition.toString (/Users/demi/git/ecma/switchedon/sync/node_modules/ews-javascript-api/js/PropertyDefinitions/TypedPropertyDefinition.js:68:21)
    at new ExtendedPropertyDefinition (/Users/demi/git/ecma/switchedon/sync/node_modules/ews-javascript-api/js/PropertyDefinitions/ExtendedPropertyDefinition.js:32:21)

Fetching calendar items not implemented?

Hello,

I am trying to fetch calendar appointments using FindAppointments (or FindItems) method.
It looks like CalendarView has no implementations for required xml serialization methods yet, so this doesn't work.

Is there another way to search for meetings by date range?
If not, could you please give a hint on proper implementation of CalendarView's required methods (I am new to TypeScript and EWS)?

Send attachments

Hello

is sending file attachment supported yet?

Also, my company is looking into extending OWA. I am wondering if you are interested in working together. If you are, please contact me at [email protected]

Thanks

Cookies Authentication behind TMG - Error when calling GetUserAvailability method

Hello, First thank you for this module,
I'm trying to call GetUserAvailability from meteorjs application (the code is same like in readme file).

I'm getting the following error:

I20151014-18:57:28.056(2)? [ServiceObjectPropertyDefinition.ctor] uri is null or empty
I20151014-18:57:29.245(2)? [ServiceObjectPropertyDefinition.ctor] uri is null or empty
I20151014-18:57:29.246(2)? [ServiceObjectPropertyDefinition.ctor] uri is null or empty
I20151014-18:57:29.247(2)? [ServiceObjectPropertyDefinition.ctor] uri is null or empty
I20151014-18:57:29.247(2)? sending ews request
I20151014-18:57:29.247(2)? { url: 'https://mail.xxxx.com/EWS/Exchange.asmx',
I20151014-18:57:29.247(2)? headers:
I20151014-18:57:29.247(2)? { 'Content-Type': 'text/xml; charset=utf-8',
I20151014-18:57:29.248(2)? Accept: 'text/xml',
I20151014-18:57:29.248(2)? Authorization: 'Basic aWd1aXNzb3VtYTpA==' },
I20151014-18:57:29.248(2)? type: 'POST',
I20151014-18:57:29.248(2)? data: '<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="h
ttp://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">soap:Header<t:RequestServerVersion Vers
ion="Exchange2010">/t:RequestServerVersion<t:TimeZoneContext><t:TimeZoneDefinition Name="UTC" Id="UTC">/t:TimeZoneDefinition/t:TimeZoneContext/soap:Header<soap:Bo
dy><m:GetUserAvailabilityRequest><m:MailboxDataArray><t:MailboxData><t:Email><t:Address>[email protected]/t:Address/t:Email<t:AttendeeType>Required</t:AttendeeTy
pe><t:ExcludeConflicts>false/t:ExcludeConflicts/t:MailboxData/m:MailboxDataArray<t:FreeBusyViewOptions><t:TimeWindow><t:StartTime>2015-10-14T00:00:00/t:StartTime<
t:EndTime>2015-10-16T00:00:00/t:EndTime/t:TimeWindow<t:MergedFreeBusyIntervalInMinutes>30/t:MergedFreeBusyIntervalInMinutes<t:RequestedView>Detailed</t:RequestedVie
w>/t:FreeBusyViewOptions/m:GetUserAvailabilityRequest/soap:Body/soap:Envelope' }
I20151014-18:57:29.287(2)? Error in calling service, error code:0
I20151014-18:57:29.287(2)? -----------error
I20151014-18:57:29.288(2)? null

When I tied the SoapRequest with another tool I get the followin error:

a:ErrorMissingArgumentYou must specify TimeZone.5028/m:ErrorCode/s:Fault/s:Body/s:Envelope

To fix the request soap I have to add like this:

        <t:TimeZone>
            <t:Bias>0</t:Bias>
            <t:StandardTime>
                <t:Bias>0</t:Bias>
                <t:Time>02:00:00</t:Time>
                <t:DayOrder>1</t:DayOrder>
                <t:Month>3</t:Month>
                <t:DayOfWeek>Sunday</t:DayOfWeek>
            </t:StandardTime>
            <t:DaylightTime>
                <t:Bias>0</t:Bias>
                <t:Time>02:00:00</t:Time>
                <t:DayOrder>1</t:DayOrder>
                <t:Month>10</t:Month>
                <t:DayOfWeek>Sunday</t:DayOfWeek>
            </t:DaylightTime>
        </t:TimeZone>

Do you have any idea how to fix this issue.
thx in advance.

Issues with Autodiscover

Trying to use the example you have here for autodiscovery and getting user settings however I am hitting a snag when it comes to the Autodiscovery itself.

I have the AutoDiscoverService set up as:

var autod = new ews.AutodiscoverService(ews.ExchangeVersion.Exchange2013);

I then do

autod.Credentials = new ews.ExchangeCredentials("testuser", "testpass", "mydomain");

I also change the autod.GetUserSettings() to have the correct email address in it, however when I run the code via node I get the following issue:

Determining which endpoints are enabled for host autodiscover.example.com Host returned enabled endpoint flags: Legacy,Soap,WsSecurity,OAuth --hard checking for office 365 with node.js http request and presence of header x-federationtrusttokenissueruri: urn:federation:MicrosoftOnline. All other redirection wil fail Trying to get Autodiscover redirection URL from http://autodiscover.example.com/autodiscover/autodiscover.xml. --Request error: 403, Forbidden

(Obviously changed the actual domain to example.com just for this issue)

There is no 'autodiscover' subdomain on my domain, it is 'mail', also, with Exchange 2016 it looks like (at least on my server) that it is: mail.example.com/Autodiscover/Autodiscover.xml (not the capital A).

error code:0

Hello everyone,

I'm trying to connect to my exchange server (Azure VM + exchange server 2016 + but without autodiscover) with the following code:

`var ews = require('ews-javascript-api');
var exch = new ews.ExchangeService(ews.ExchangeVersion.Exchange2016);
exch.Credentials = new ews.ExchangeCredentials("domain\login", "password");
exch.Url = new ews.Uri("https://XXXXX.cloudapp.net/EWS/Exchange.asmx"); 

var attendee =[ new ews.AttendeeInfo("[email protected]")];
var timeWindow = new ews.TimeWindow(ews.DateTime.Now, new ews.DateTime(ews.DateTime.Now.TotalMilliSeconds + ews.TimeSpan.FromHours(48).asMilliseconds())); 
exch.GetUserAvailability(attendee, timeWindow, ews.AvailabilityData.FreeBusyAndSuggestions)
.then(function (availabilityResponse) {
  //do what you want with user availability
    console.log(availabilityResponse)
}, function (errors) {
  //log errors or do something with errors
    console.log(errors)
});`

The Ews request is the following :

`sending ews request
{ url: �[32m'https://XXXX.cloudapp.net/EWS/Exchange.asmx'�[39m,
  headers: 
   { �[32m'Content-Type'�[39m: �[32m'text/xml; charset=utf-8'�[39m,
     Accept: �[32m'text/xml'�[39m,
     Authorization: �[32m'Basic QkXXXXXXXXXXXXXXXXXXXXdXIwMQ=='�[39m },
  type: �[32m'POST'�[39m,
  data: �[32m'<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types"><soap:Header><t:RequestServerVersion Version="Exchange2016"></t:RequestServerVersion><t:TimeZoneContext><t:TimeZoneDefinition Name="UTC" Id="UTC"></t:TimeZoneDefinition></t:TimeZoneContext></soap:Header><soap:Body><m:GetUserAvailabilityRequest><m:MailboxDataArray><t:MailboxData><t:Email><t:Address>[email protected]</t:Address></t:Email><t:AttendeeType>Required</t:AttendeeType><t:ExcludeConflicts>false</t:ExcludeConflicts></t:MailboxData></m:MailboxDataArray><t:FreeBusyViewOptions><t:TimeWindow><t:StartTime>2016-06-04T00:00:00</t:StartTime><t:EndTime>2016-06-06T00:00:00</t:EndTime></t:TimeWindow><t:MergedFreeBusyIntervalInMinutes>30</t:MergedFreeBusyIntervalInMinutes><t:RequestedView>Detailed</t:RequestedView></t:FreeBusyViewOptions><t:SuggestionsViewOptions><t:GoodThreshold>25</t:GoodThreshold><t:MaximumResultsByDay>10</t:MaximumResultsByDay><t:MaximumNonWorkHourResultsByDay>0</t:MaximumNonWorkHourResultsByDay><t:MeetingDurationInMinutes>60</t:MeetingDurationInMinutes><t:MinimumSuggestionQuality>Fair</t:MinimumSuggestionQuality><t:DetailedSuggestionsWindow><t:StartTime>2016-06-04T00:00:00</t:StartTime><t:EndTime>2016-06-06T00:00:00</t:EndTime></t:DetailedSuggestionsWindow></t:SuggestionsViewOptions></m:GetUserAvailabilityRequest></soap:Body></soap:Envelope>'�[39m }
`

And i got the following error :

Error in calling service, error code:0

Am I doing something wrong?? Or maybe the server is not configured properly??

Cheers,

FindItems with SearchFilter and Extended Property

I'm trying to use ews.IsEqualTo as a search filter for a specific message header, with a property definition like this:
new ews.ExtendedPropertyDefinition(ews.DefaultExtendedPropertySet.InternetHeaders, 'header-name', ews.MapiPropertyType.String)

When I try to use any filter with FindItems(), I get the following error:
[Error: SearchFilter.ts - WriteToXml : Not implemented.]

Bit confusing given that it says here there are some available filters:

* @param {searchFilter} searchFilter The search filter. Available search filter classes include SearchFilter.IsEqualTo, SearchFilter.ContainsSubstring and SearchFilter.SearchFilterCollection

Am I doing something wrong? Or can nothing happen until SearchFilter.WriteToXml() is implemented?

Is StreamingSubscriptionConnection api working on NTLM auth?

this is my code -

var Streaming = new  ews.StreamingSubscriptionConnection(exch,1);

exch.SubscribeToStreamingNotificationsOnAllFolders([1]).then(function(responses){
    console.log('oo');
    Streaming.AddSubscription(responses);
    Streaming.OnNotificationEvent.push(function(){
        console.log('aa');
    });
    Streaming.Open();
},function(responses){
    console.log('xx');
}) 

but when event hapen
OnNotificationEvent not work

I use ntlmXHRApi to auth Streaming
maybe is ntlmXHRApi not support Streaming

have any way can make Streaming working on ntlmXHRApi?

GetUserAvailability issue

I am trying to use the use the GetUserAvailability function, literally, just like your example and nothing else, i get success with the GetPasswordExpirationDate method but GetUserAvailability I just get an error:

ErrorTypeError: Cannot read property 'Validate' of null

Do you have any thought about it?

Thank you!

NTLM authentication

Hi,

(Think this is a feature request).

Was trying to use this framework which looks really nice, but discovered that the exchange server I am using is configured for NTLM authentication.

I used a nodejs package https://github.com/tcr/node-ntlm where the demonstration worked when I tried it by adding simple EWS SOAP xml to the body of the second request (after the challenge).

I tried to have a look at the code for the EWS to see if I could implement it, but became quite lost as my node skills aren't up there yet, and got as far as seeing that Basic authentication is used.

Thanks,
Jarrod

Using require('ews-javascript-api') throws "Error: Cannot find module '../Extensionmethods'"

Using Node v4.4.0, the "require" statement throws this error. You can also see this on the npm package site.

Full output:

vagrant@vagrant-ubuntu-trusty-64:~/test$ node app.js 
module.js:327
    throw err;
    ^

Error: Cannot find module '../Extensionmethods'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/home/vagrant/test/node_modules/ews-javascript-api/js/PropertyDefinitions/PropertyDefinitionBase.js:6:26)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)

Autodiscover http 302/redirect check must not provide credential to avoid any credential leak over unsecure http

Autodiscover uses heuristics to connect to https://autodiscover.domain.com/autodiscover/autodiscover.xml or .svc. and then https://domain.com/autodiscover/autodiscover.xml or .svc

if these two call fail, it fail backs to http://autodiscover.domain.com/autodiscover/autodiscover.xml to check 302 redirect. (current issue in node v8 engine as well as browser XHR that it redirects automatically, the call fail in any case)
this lib does try to authenticate with O365 in case 302 redirect fail and some specific header present in http response.

Item.ts - SetSubject : Not implemented.

Hi,

First of all I want to say thanks for the great module. I have a little issue, I am getting the following error, Error: Item.ts - SetSubject : Not implemented, when trying to create a new appointment on the calendar. I looked a bit through the code and I saw that this feature is not yet implemented. Any ETA on when we can expect it?
I am trying to understand what I can do to implement this, in case you don't have time, but it seems fairly complex, any help or notes you might have?

The code in question:

  var appointment = new ews.Appointment(exch);
  appointment.Subject = "Dentist Appointment";
  appointment.Body = "The appointment is with Dr. Smith.";
  appointment.Start = new DateTime(2016, 3, 1, 9, 0, 0);
  appointment.End = appointment.Start.AddHours(2);
  appointment.Save(SendInvitationsMode.SendToNone);

AutoDiscover: silently fails the script when one of the user is not found

for user mailbox not found in Exchange, it sends null for value of UserSettings filed. Error in script throws error when checking properties on null valued object.
#60 has reported this.

fixing in next release.

workaround:
change line 169 in "GetUserSettingsResponse.js" file of current release (0.4)
from

    GetUserSettingsResponse.prototype.LoadUserSettingsFromJson = function (obj) {
        var settings = undefined;
        if (typeof (obj[XmlElementNames_1.XmlElementNames.UserSetting]) === 'undefined')  //Line 169
            return;

to

    GetUserSettingsResponse.prototype.LoadUserSettingsFromJson = function (obj) {
        var settings = undefined;
        if (!obj || typeof (obj[XmlElementNames_1.XmlElementNames.UserSetting]) === 'undefined')
            return;

and line 155 in same file from

    GetUserSettingsResponse.prototype.LoadUserSettingErrorsFromJson = function (obj) {
        var errors = undefined;
        if (typeof (obj[XmlElementNames_1.XmlElementNames.UserSettingError]) === 'undefined') //Line 155
            return;

to

    GetUserSettingsResponse.prototype.LoadUserSettingErrorsFromJson = function (obj) {
        var errors = undefined;
        if (!obj || typeof (obj[XmlElementNames_1.XmlElementNames.UserSettingError]) === 'undefined')
            return;

FindFolders not continue when ews return error

I'm trying to verify the existence of a mailbox using the function FindFolders.
My code is:

var folderid = new ews.FolderId(ews.WellKnownFolderName.Inbox, new ews.Mailbox("[email protected]"));
service.FindFolders(folderid, new ews.FolderView(10)).then(function(response) {
console.log("OK");
}, function(error) {
console.log("ERROR");
});
console.log("CONTINUE");

When the mailbox exists it works great but when the mailbox is not found, no console.log command is executed and the script doesn't continue.

EWS answers correctly this error:

Body:
{ __prefix: 's',
FindFolderResponse:
{ __prefix: 'm',
__type: 'FindFolderResponse',
ResponseMessages:
{ __prefix: 'm',
__type: 'ResponseMessages',
FindFolderResponseMessage:
{ __prefix: 'm',
__type: 'FindFolderResponseMessage',
ResponseClass: 'Error',
MessageText: 'The SMTP address has no mailbox associated with it.',
ResponseCode: 'ErrorNonExistentMailbox',
DescriptiveLinkKey: '0',
MessageXml:
{ __prefix: 'm',
__type: 'MessageXml',
Value:
{ __prefix: 't',
__type: 'Value',
Name: 'SmtpAddress',
Value: '[email protected]' } } } } } } }

can you help me? Excuse me for the countless requests and excuse me for my bad English

Best Regards

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.