Skip to content

Instantly share code, notes, and snippets.

@amlwwalker
Created March 3, 2017 15:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amlwwalker/2cf8e90d1988937313cfa9bc4cb21da4 to your computer and use it in GitHub Desktop.
Save amlwwalker/2cf8e90d1988937313cfa9bc4cb21da4 to your computer and use it in GitHub Desktop.
Outlook Headers retrieval start...
var queryParams = {
'$select': 'Subject,ReceivedDateTime,From,SingleValueExtendedProperties',
'$orderby': 'ReceivedDateTime desc',
'$top': 10,
'$expand': 'SingleValueExtendedProperties($filter=PropertyId eq \'String 0x7D\')'
};
var token = req.session.access_token;
var email = req.session.email;
// Set the API endpoint to use the v2.0 endpoint
outlook.base.setApiEndpoint('https://outlook.office.com/api/v2.0');
// Set the anchor mailbox to the user's SMTP address
outlook.base.setAnchorMailbox(email);
outlook.mail.getMessages({token: token, odataParams: queryParams},
function(error, result){
result.value.forEach(function(message) {
console.log('Properties: ' + message.SingleValueExtendedProperties);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment