GraphAPI not populating email sender/from/to

Moore, Kyle 1 Reputation point

Querying any message from any mailbox always returns the following:

sender : @{emailAddress=}
from : @{emailAddress=}
toRecipients : {@{emailAddress=}}

The other fields are populated as expected. What can I do?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
9,122 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Gopinath Chennamadhavuni 2,416 Reputation points

    Adding @Moore, Kyle comment/solution as answer to this QnA post:

    "I am using Invoke-RestMethod in PowerShell. The fields in the output display in the above way if I echo a message object, but if I instead echo only $message.sender for example, it displays the full content of the array as expected. So, the API is returning the information I need, but PowerShell was for some reason failing to display it properly. But if I attempt to manipulate the child objects directly, I am able to do what I need. If I convert the output to JSON, it also seems to fix the display issue when echoing/printing."

    0 comments No comments