[英]Microsoft Graph API to fetch Outlook Mails, C# Console Application
How can I fetch Outlook mails using Microsoft Graph API? 如何使用Microsoft Graph API提取Outlook邮件?
I want to create ac# Console based application which will run after every 20 min and will fetch mails. 我想创建一个基于ac#控制台的应用程序,该应用程序每20分钟运行一次,并提取邮件。
I have generated access Token with the help of following code. 我已经在以下代码的帮助下生成了访问令牌。
static async Task<string> getAccessToken() { authContext = new AuthenticationContext("https://login.microsoftonline.com/tenantId"); result = await authContext.AcquireTokenAsync(resourceUri, clientCredential); Console.WriteLine(result.AccessToken); }
I also want to understand the difference between /me
and /user/{UserID}
. 我还想了解/me
和/user/{UserID}
之间的区别。
You can get messages using the messages endpoint: 您可以使用messages端点获取消息:
GET /me/messages
GET /users/{id | userPrincipalName}/messages
You put the auth token you got in the authorization header. 您将获得的auth令牌放入授权标头中。
/me
- scopes the request to the user you generated the token for. /me
me-将请求范围限定在为其生成令牌的用户。 /users/{id}
- scopes the request to the user you specified the id for. /users/{id}
-将请求范围限定到您为其指定ID的用户。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.