Skip to content

Commit b84171a

Browse files
authored
Update filter-as-segment.md
1 parent b7d1110 commit b84171a

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

graph/articles/filter-as-segment.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ For example, the `riskyUsers` API on Microsoft Graph has an action defined to le
66

77
```xml
88
<Action Name="dismiss" IsBound="true">
9-
<Parameter Name="bindingParameter" Type="Collection(self.riskyUser)" />
9+
<Parameter Name="bindingParameter" Type="Collection(microsoft.graph.riskyUser)" />
1010
<Parameter Name="userIds" Type="Collection(Edm.String)" />
1111
</Action>
1212
```
@@ -32,20 +32,26 @@ in order to dismiss the risky users with the provided IDs. Using the filter-as-s
3232
</Action>
3333
```
3434

35-
and clients could call:
35+
and clients could call
3636

3737
```http
38-
POST /identityProtection/riskyUsers/$filter=@f/dismiss?@f=id IN ({userId1},{userId2},...)
38+
POST /identityProtection/riskyUsers/$filter=@f/dismiss?@f=id IN ('{userId1}','{userId2}',...)
3939
```
4040

4141
Doing this is beneficial due to the robust nature of OData filter expressions: clients will be able to dismiss risky users based on any supported filter without the service team needing to implement a new `dismiss` overload that filters based on the new criteria.
4242
However, there are some concerns about the discoverability of using the filter-as-segment feature, as well as the support of [parameter aliasing](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part2-url-conventions.html#sec_ParameterAliases) that's required.
4343
As a result, functions should be introduced that act in the same way as the filter-as-segment:
4444

4545
```xml
46-
<Function Name="userFilter" IsBound="true" IsComposable="true">
47-
<Parameter Name="bindingParameter" Type="Collection(Microsoft.DirectoryServices.user)" Nullable="false" />
46+
<Function Name="filter" IsBound="true" IsComposable="true">
47+
<Parameter Name="bindingParameter" Type="Collection(microsoft.graph.riskyUser)" Nullable="false" />
4848
<Parameter Name="expression" Type="Edm.String" Nullable="false" />
49-
<ReturnType Type="Collection(Microsoft.DirectoryServices.user)" />
49+
<ReturnType Type="Collection(microsoft.graph.riskyUser)" />
5050
</Function>
5151
```
52+
53+
Clients would now be able to call
54+
55+
```http
56+
POST /identityProtection/riskyUsers/filter(expression='id IN (''{userId1}'',''{userId2}'',...)')/dismiss
57+
```

0 commit comments

Comments
 (0)