You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert

18
+
19
19
## Examples
20
-
The following examples assume that you have a valid access token. We used [isomorphic-fetch](https://www.npmjs.com/package/isomorphic-fetch) to perform requests, but you can use [our JavaScript client library](https://github.com/microsoftgraph/msgraph-sdk-javascript) or other libraries as well.
The following examples assume that you have a valid access token. The following example uses [isomorphic-fetch](https://www.npmjs.com/package/isomorphic-fetch) and [Microsoft Graph JavaScript client library](https://github.com/microsoftgraph/msgraph-sdk-javascript) -
23
21
24
-
import*from'isomorphic-fetch';
25
-
const accessToken:string="";
26
-
```
27
-
### List my recent messages
28
22
```typescript
29
-
let url ="https://graph.microsoft.com/v1.0/me/messages";
30
-
let request =newRequest(url, {
31
-
method: "GET",
32
-
headers: newHeaders({
33
-
"Authorization": "Bearer "+accessToken
34
-
})
35
-
});
23
+
import { User } from"@microsoft/microsoft-graph-types-beta";
36
24
37
-
fetch(request)
38
-
.then((response) => {
39
-
response.json().then((res) => {
40
-
let messages:[MicrosoftGraph.Message] =res.value;
41
-
for (let msg ofmessages) { //iterate through the recent messages
0 commit comments