nmarus / node-ews

A simple JSON wrapper for the Exchange Web Services (EWS) SOAP API.
MIT License
116 stars 52 forks source link

Get folder issue #88

Closed christiannguyen closed 6 years ago

christiannguyen commented 6 years ago
const ewsConfig = {
  username: 'myusernamehere',
  password: 'mypassword',
  host: 'https://outlook.office365.com',
  auth: 'basic'
};

// initialize node-ews
const ews = new EWS(ewsConfig);

// define ews api function
const ewsFunction = 'GetFolder';

const ewsArgs = {
  'FolderShape': {
    'BaseShape': 'default'
  },
  'FolderIds': {
    'DistinguishedFolderId': {
      'attributes': {
        'Id': 'inbox'
      },
    }
  }
}

ews.run(ewsFunction, ewsArgs)
  .then(result => {
    console.log("RESULT HERE", result);
    console.log(JSON.stringify(result));
  })
  .catch(err => {
    console.log(err.message);
  });

Just curious what I'm doing wrong exactly here? All i get back is a:ErrorInvalidRequest: The request is invalid. I'm pretty sure I structured the code right. Sorry if i shouldn't place this here wasn't sure where else to ask this.

christiannguyen commented 6 years ago

Nevermind. I realized it was a capitalization issue with default lol. Sorry can just close it out.