nmarus / node-ews

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

Can not use GetItem #63

Closed KaRonS closed 7 years ago

KaRonS commented 7 years ago

So I am trying to do a 'GetItem' request in this, but it does not work. Keeps giving me an internal Server Error. I do not know if it's not in the package, or it's just my error. I have the Id and ChangeKey for this, so I'm puzzled.

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

// define ews api function 
let ewsFunction = 'GetItem';

// define ews api function args 
let ewsArgs = {
    // 'attributes': {
    //     'Traversal': 'Shallow'
    //   },
    "ItemShape": {
        "BaseShape": "Default",
        "IncludeMimeContent": true
    },
    "ItemIds": {
        itemId: {
            "attributes": {
                Id: "AAAaAEtBU2NvdHRAbXkuaGFycmlzYnVyZ3UuZWR1AEYAAAAAALeP9VMUxP5Om1DbRw7eOHsHAJmvOHIJ5yFAtMD9bPUSUUsAAAD32fIAABZ9l01KtYlPs7oHxNxGh+wAAzIl/1MAAA==",
                ChangeKey: "CQAAABYAAAAWfZdNSrWJT7O6B8TcRofsAAMyjnmN"
            }
        }

    }
};

// query ews, print resulting JSON to console 
ews.run(ewsFunction, ewsArgs)
    .then(result => {
console.log(JSON.stringify(result));
 })
    .catch(err => {
        console.log(err.stack);
    });
KaRonS commented 7 years ago

It was capitalization in ItemId... Very Sorry, this is a good reference to doing the Get Item still though.

kcastrotech commented 7 years ago

That'll do it. Thanks for the follow up.