Graph mail api - get list of emails and include outlook custom columns

Zarko Petrovic 40 Reputation points
2023-08-28T10:51:51.2433333+00:00

Hi,

We are using MS Graph api to fetch user's emails from Outlook.

Is there a way to fetch and filter by values of custom columns added in Outlook?

I have tried adding $expand to the odata query but that didn't work.

I tried something like this i Graph explorer:

https://graph.microsoft.com/v1.0/me/messages?$select=id,lastModifiedDateTime,from,toRecipients,subject&$expand=fields

But I am getting an BadRequest (400) response:

Parsing OData Select and Expand failed: Could not find a property named 'fields' on type 'microsoft.graph.message'.

Thanks,

Zarko

Microsoft Security Microsoft Graph
0 comments No comments
{count} votes

Accepted answer
  1. TH-4749-MSFT 3,315 Reputation points
    2023-08-28T18:13:56.25+00:00

    Hello Zarko Petrovic,

    Thanks for reaching out. There is no property called fields in the message object hence you are receiving the Bad Request error. The below article lists all the properties of the message object and these properties are the ones returned in the /messages api call response.

    https://learn.microsoft.com/en-us/graph/api/resources/message?view=graph-rest-1.0

    Retrieval of custom columns is not supported. I would suggest posting your query on the Graph feedback forum.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    Thanks.

    0 comments No comments

0 additional answers

Sort by: Most helpful

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.