Skip to content

Commit 931526c

Browse files
committed
add example
1 parent e50eb11 commit 931526c

File tree

1 file changed

+38
-14
lines changed

1 file changed

+38
-14
lines changed

graph/patterns/alternate-key.md

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,50 @@ In such case, the system SHOULD throw an exception and encourage the user to use
3939

4040
The same user identified via the alternate key SSN, the canonical (primary) key ID using the non-canonical long form with specified key property name, and the canonical short form without key property name
4141

42-
https://graph.microsoft.com/v1.0/users/1a89ade6-9f59-4fea-a139-23f84e3aef66
42+
1. Get a specific resource through `$filter`:
4343

44-
https://graph.microsoft.com/v1.0/users(ssn='123-45-6789')
44+
```http
45+
GET https://graph.microsoft.com/v1.0/users/?$filter=(ssn eq '123-45-6789')
46+
```
47+
48+
```json
49+
{
50+
"value": [
51+
{
52+
"givenName": "Bob",
53+
"jobTitle": "Retail Manager",
54+
"mail": "[email protected]",
55+
"mobilePhone": "+1 425 555 0109",
56+
"officeLocation": "18/2111",
57+
"preferredLanguage": "en-US",
58+
"surname": "Vance",
59+
"userPrincipalName": "[email protected]",
60+
"id": "1a89ade6-9f59-4fea-a139-23f84e3aef66"
61+
}
62+
]
63+
}
64+
```
4565

46-
https://graph.microsoft.com/v1.0/users(email='[email protected]')
66+
2. Get a specific resource through the alternate key:
4767

48-
All of the 3 will yield the sare response:
68+
```http
69+
GET https://graph.microsoft.com/v1.0/users/1a89ade6-9f59-4fea-a139-23f84e3aef66
70+
GET https://graph.microsoft.com/v1.0/users(ssn='123-45-6789')
71+
GET https://graph.microsoft.com/v1.0/users(email='[email protected]')
72+
```
4973

74+
All of the 3 will yield the sare response:
5075

5176
```json
5277
{
53-
"givenName": "Bob",
54-
"jobTitle": "Retail Manager",
55-
"mail": "[email protected]",
56-
"mobilePhone": "+1 425 555 0109",
57-
"officeLocation": "18/2111",
58-
"preferredLanguage": "en-US",
59-
"surname": "Vance",
60-
"userPrincipalName": "[email protected]",
61-
"id": "1a89ade6-9f59-4fea-a139-23f84e3aef66"
78+
"givenName": "Bob",
79+
"jobTitle": "Retail Manager",
80+
"mail": "[email protected]",
81+
"mobilePhone": "+1 425 555 0109",
82+
"officeLocation": "18/2111",
83+
"preferredLanguage": "en-US",
84+
"surname": "Vance",
85+
"userPrincipalName": "[email protected]",
86+
"id": "1a89ade6-9f59-4fea-a139-23f84e3aef66"
6287
}
6388
```
64-

0 commit comments

Comments
 (0)