1
votes

Every Outlook Message Payload has a Sender Attribute:

        "Sender": {
            "EmailAddress": {
                "Name": "FirstName LastName",
                "Address": "[email protected]"
            }
        }

And can be selected for via

https://outlook.office.com/api/v2.0/me/mailfolders/inbox/messages?$select=sender

But how would one go about selecting for Sender.EmailAddress.Address?

1

1 Answers

0
votes

You are joggling with terms. According to API documentation for Message The list of properties indicate you are able to select from the message 'Sender' (or 'From') property. This is exactly what you do. The return type of those properties is 'Recipient' with is corresponding to the property 'EmailAddress' with complex type of 'EmailAddress'. This type include two properties on it's own 'Name' and 'Address'. This is exactly what your example JSON displays.

But how would one go about selecting for Sender.EmailAddress.Address?

You are able to select the property of the message (see above description and the API reference for the properies of the message). If property type is complex, you need to deal with it in your code. In fact this particular property is very trivial JSON and you just access the property of the object via objects accessor (.) or with brakets notation ([]).