Graph API - Filter on extension attributes

Akshay Shambhu Bajpayee 0 Reputation points
2023-06-13T14:59:09.0133333+00:00

Hello,

We have created an application which contains extension attributes added to it from Graph API.

Hence it follows the naming convention as extension_<client_id>_<fieldName>

I want to filter add filter when fetching the user.

I have tried with the following ways in the postman collection

  • extension_<client_id>_<fieldName> eq 'value'
  • startswith(extension_<client_id>_market, 'es')

I am getting the following error:

{type: "Error", name: "TypeError", message: "Cannot read properties of undefined (reading 'id')"}

Please let me know what I can do to resolve this?

Microsoft Security Microsoft Graph
{count} votes

1 answer

Sort by: Most helpful
  1. TH-4749-MSFT 3,315 Reputation points
    2023-06-13T16:08:29.8733333+00:00

    Hello Akshay Shambhu Bajpayee,

    Thanks for reaching out. You can filter for the extension attributes using the example below:

    https://graph.microsoft.com/v1.0/users?$filter=extension_07bdff858d154d1786c9f77dd25f5ea7_market/any(s:s eq 'es').

    You can find more information on Graph filtering here https://learn.microsoft.com/en-us/graph/filter-query-parameter?tabs=http.

    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.


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.