GraphAPI not populating email sender/from/to

Moore, Kyle 1 Reputation point
2022-10-24T19:49:04.673+00:00

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.
12,020 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Gopinath Chennamadhavuni 2,436 Reputation points
    2022-10-27T03:43:28.9+00:00

    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.