Graph API: how to filter contacts email addresses by a domain and remove odata.etag

Viewed 318

Currently Microsoft Graph API is fetching only limited number of contacts

GET https://graph.microsoft.com/v1.0/me/contacts?$select=emailAddresses

I'm trying to fetch specific domain users from contacts like gmail.com,yahoo.com,hotmail.com etc.

How can I filter contacts by a domain?

Is it possible to remove the @odata.etag from the response?

{
    "@odata.etag": "W/\"EQAAABYAAAA7dvnHzGk5R7sHHysSXK7DAACr9QQo\"",
    "id": "AQMkADAwATMwMAItMzdhMS02YTgwLTAwAi0wMAoARgAAA1uMJPrjGhBAoUs_D2djgpAHADt2_cfMaTlHuwcfKxJcrsMAAAIBDgAAADt2_cfMaTlHuwcfKxJcrsMAAACr-pPFAAAA",
    "emailAddresses": [
        {
            "name": "bmalet@yahoo.com",
            "address": "bmalet@yahoo.com"
        }
    ]
}
1 Answers

You cannot filter contacts by a domain. You cannot apply any other operator or function with $filter, such as ne, le, and startswith().

To remove @odata.etag you need to add a request header

Accept: application/json;odata.metadata=none

Resources:

Contacts: Optional query parameters

Related