简体   繁体   English

Microsoft Graph API来获取Outlook邮件,C#控制台应用程序

[英]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.

相关问题 Microsoft Graph - 创建 Outlook/团队会议作为 application.Net/C# - Microsoft Graph - Create outlook/teams meeting as a application .Net/C# 如何在C#控制台应用程序中使用Microsoft图形资源管理器? - How to use the Microsoft graph explorer in c# console application? 使用Microsoft.Graph通过C#控制台应用程序列出日历 - Using Microsoft.Graph to list calendars with C# Console Application 无法通过 Microsoft Graph API(C# 控制台)发送电子邮件 - Unable to send email via Microsoft Graph API (C# Console) Microsoft Graph API无法发送电子邮件C#控制台 - Microsoft Graph API unable to Send Email C# Console 请提供参考/指导以在Asp.Net MVC(C#)中制作一个用于管理邮件的Web应用程序(例如Microsoft Outlook) - Please give reference/guidance to make a web application for managing mails(like Microsoft Outlook ) in Asp.Net MVC(C#) Graph API-在Microsoft图形控制台应用程序中获取权限不足 - Graph API - Getting Insufficient privileges in microsoft graph console application 使用搜索 Microsoft Graph API C# - Use search Microsoft Graph API C# C#中的Microsoft Graph API基本应用程序 - Microsoft Graph API basic app in C# 提取Outlook日历邮件 - Fetch Outlook Calendar Mails
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM