none
Outlook Mail Rest API - JavaScript Tutorial (Web App) RRS feed

  • Question

  • I want to extract all the contents from this API. Right now the documentation ( https://docs.microsoft.com/en-us/outlook/rest/javascript-tutorial ) only provides a way to extract the subject, received data and body preview. I want to get all the fields that is returned by the API. 

    Following is the snippet of the code which shows the API Javascript code. 

    function getUserInboxMessages(callback) { getAccessToken(function(accessToken) { if (accessToken) { // Create a Graph client var client = MicrosoftGraph.Client.init({ authProvider: (done) => { // Just return the token done(null, accessToken); } }); // Get the 10 newest messages client .api('/me/mailfolders/inbox/messages') .top(10) .select('subject,from,receivedDateTime,bodyPreview') .orderby('receivedDateTime DESC') .get((err, res) => { if (err) { callback(null, err); } else { callback(res.value); } }); } else { var error = { responseText: 'Could not retrieve access token' }; callback(null, error); } }); }

      

    • Edited by AJ-12 Thursday, October 24, 2019 2:22 PM
    Thursday, October 24, 2019 2:19 PM