如何使用Microsoft Graph API获取整个msg文件? [英] How to use Microsoft Graph API to get the whole msg file?

查看:93
本文介绍了如何使用Microsoft Graph API获取整个msg文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Microsoft Graph API的新手。最近我们要求使用API​​从outlook文件夹中获取数据并将其保存到msg文件中。 

Hi, I'm new to Microsoft Graph API. Recently we have a requirement that to use API to fetch data from outlook folder and save them into msg files. 

我正在尝试使用  https://graph.microsoft.com /v1.0/me/messages 但我只能获取不在实际格式化文件中的详细列信息。任何人都可以帮助我吗?谢谢。

I am trying to use https://graph.microsoft.com/v1.0/me/messages  but I can only get the detailed column information not in the actual formatted file. Anyone can help me with that? Thank you.




推荐答案

Hello ViviTong,

Hello ViviTong,

您能描述一下msg文件的更多细节吗?您想要存储什么样的文件格式以及您希望获得哪些消息?下面的代码是我从"body"获得的:

Could you describe more detail about the msg file? What kind of file format you would like to store and what part of message you want to get? The code below is what i get from "body":

"body": {
                "contentType": "html",
                "content": "<html>\r\n<head>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\r\n<meta content=\"text/html; charset=utf-8\">\r\n</head>\r\n<body bgcolor=\"#ffffff\" lang=\"EN-US\" link=\"#333333\" vlink=\"#6D6D6D\" style=\"background-color:#ffffff\">\r\n<div style=\"padding:5px 0px 0px 5px\">\r\n<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"95%\">\r\n<tbody>\r\n<tr>\r\n<td bgcolor=\"#ffffff\" valign=\"top\" style=\"vertical-align:top; padding:0px 0px 0px 0px\">\r\n<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td valign=\"top\" align=\"left\" bgcolor=\"#ffffff\" style=\"padding- padding-bottom:14px\">\r\n<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td valign=\"top\" align=\"left\" bgcolor=\"#ffffff\" style=\"padding-><img alt=\"Microsoft\" src=\"https://asgcdn.blob.core.windows.net/office-email-templates/logo_microsoft.png\" width=\"99\" height=\"21\" align=\"left\" class=\"mobile-width-85\" style=\"display:block; outline:none; border:none\">\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</td>\r\n<td valign=\"top\" align=\"right\" bgcolor=\"#ffffff\" style=\"padding- padding-bottom:14px\">\r\n<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td valign=\"top\" align=\"right\" bgcolor=\"#ffffff\" style=\"padding-right:0px\"><img alt=\"Microsoft Planner\" src=\"https://tasks.office.com/images/PlannerRightAligned.png\" width=\"138\" height=\"18\" align=\"right\" class=\"mobile-width-117\" style=\"display:block; outline:none; border:none\">\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tbody>\r\n<tr>\r\n<td width=\"64px\" style=\"width:64px; padding:10px 0px 0px 0px\">\r\n<div><img border=\"0\" width=\"40px\" height=\"40px\" id=\"Planner_logo\" alt=\"Microsoft Planner\" src=\"https://tasks.office.com/images/PlannerLogo40x40.png\" style=\"height:40px; width:40px\">\r\n</div>\r\n</td>\r\n<td style=\"padding:10px 0px 0px 0px\">\r\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\r\n<tbody>\r\n<tr>\r\n<td style=\"padding:0in 0in 8px 0in\">\r\n<div><span style=\"font-size:16px; font-family:Segoe UI,sans-serif; color:#364147; font-style:regular\">Hi Megan,\r\n</span></div>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td style=\"padding:0in 0in 0in 0in\">\r\n<div><span style=\"font-size:14px; font-family:Segoe UI,sans-serif; color:#364147; font-style:regular\">You have 2 tasks due in Microsoft Planner.\r\n</span></div>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td style=\"padding:32px 0px 4px 0px\">\r\n<div><span style=\"font-size:20px; font-family:Segoe UI,sans-serif; color:#364147; font-style:regular\">Late\r\n</span></div>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td style=\"border-bottom:1pt solid #eaeaea\">\r\n<table style=\"border-collapse:collapse\">\r\n<tbody>\r\n<tr>\r\n<td style=\"padding:12px 8px 0px 0px; width:90px; vertical-align:text-top\">\r\n<div><span style=\"font-size:14px; font-family:Segoe UI,sans-serif; color:#d63867; font-style:regular\">8/13/2018\r\n</span></div>\r\n</td>\r\n<td style=\"padding:12px 0px 0px 0px; width:600px\">\r\n<div><span style=\"text-decoration:none\"><a href=\"https://tasks.office.com/M365x214355.onmicrosoft.com/en-US/Home/PlanViews/axfL6rGxbkST4MLr9I3IemUAAF5w/9kd5ujJDhkWUPGORUPIJmWUAHTRJ?Type=DueDate&amp;Channel=Email&amp;CreatedTime=636703824826711886&amp;Exp=ddnrt\" style=\"font-size:14px; font-family:Segoe UI,sans-serif; color:#364147; font-style:regular; text-decoration:underline\">Office\r\n move planning </a></span></div>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td style=\"padding:8px 8px 8px 0px; width:90px\"></td>\r\n<td style=\"padding:8px 0px 8px 0px; width:600px\">\r\n<div><span style=\"text-decoration:none\"><a href=\"https://tasks.office.com/M365x214355.onmicrosoft.com/en-US/Home/PlanViews/axfL6rGxbkST4MLr9I3IemUAAF5w?Type=DueDate&amp;Channel=Email&amp;CreatedTime=636703824826711886&amp;Exp=ddnrt\" style=\"font-size:12px; font-family:Segoe UI,sans-serif; color:#666666; font-style:regular; text-decoration:none\">IT\r\n</a></span></div>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td style=\"border-bottom:1pt solid #eaeaea\">\r\n<table style=\"border-collapse:collapse\">\r\n<tbody>\r\n<tr>\r\n<td style=\"padding:12px 8px 0px 0px; width:90px; vertical-align:text-top\">\r\n<div><span style=\"font-size:14px; font-family:Segoe UI,sans-serif; color:#d63867; font-style:regular\">8/13/2018\r\n</span></div>\r\n</td>\r\n<td style=\"padding:12px 0px 0px 0px; width:600px\">\r\n<div><span style=\"text-decoration:none\"><a href=\"https://tasks.office.com/M365x214355.onmicrosoft.com/en-US/Home/PlanViews/Ey4oAJeTv0W6kx-kD4T-kGUAHEwE/Hx1G5K_MWUaSO56kC28aEWUABz3S?Type=DueDate&amp;Channel=Email&amp;CreatedTime=636703824826711886&amp;Exp=ddnrt\" style=\"font-size:14px; font-family:Segoe UI,sans-serif; color:#364147; font-style:regular; text-decoration:underline\">Visual\r\n Branding Elements </a></span></div>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td style=\"padding:8px 8px 8px 0px; width:90px\"></td>\r\n<td style=\"padding:8px 0px 8px 0px; width:600px\">\r\n<div><span style=\"text-decoration:none\"><a href=\"https://tasks.office.com/M365x214355.onmicrosoft.com/en-US/Home/PlanViews/Ey4oAJeTv0W6kx-kD4T-kGUAHEwE?Type=DueDate&amp;Channel=Email&amp;CreatedTime=636703824826711886&amp;Exp=ddnrt\" style=\"font-size:12px; font-family:Segoe UI,sans-serif; color:#666666; font-style:regular; text-decoration:none\">Marketing\r\n</a></span></div>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n<table>\r\n<tbody>\r\n<tr>\r\n<td style=\"padding:48px 0px 16px 0px\">\r\n<div><span style=\"font-size:14px; font-family:Segoe UI,sans-serif; color:#364147\">This notification is sent by Microsoft Planner.<br>\r\n<br>\r\nTo change your notification settings, go to Planner for web, choose the gear icon in the top right, and then select Notifications.\r\n<a href=\"https://go.microsoft.com/fwlink/?linkid=853944\">Learn more</a> </span></div>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td style=\"padding:16px 0px 32px 0px\">\r\n<div><span style=\"font-size:14px; font-family:Segoe UI,sans-serif; color:#364147\">Get the Planner app for\r\n<a href=\"https://go.microsoft.com/fwlink/?linkid=853824\">iPhone</a> or <a href=\"https://go.microsoft.com/fwlink/?linkid=853825\">\r\nAndroid</a> </span></div>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"95%\">\r\n<tbody>\r\n<tr>\r\n<td bgcolor=\"#f0f0f0\" valign=\"top\" style=\"vertical-align:top; padding->\r\n<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td bgcolor=\"#f0f0f0\" align=\"left\" class=\"mobile-side-padding-20\" style=\"font-family:'Segoe UI',SUWR,Verdana,sans-serif; font-size:10px; line-height:14px; color:#6b6b6b; padding- padding- padding-right:20px; text-align:left; letter-spacing:-0.01em\">\r\n<p style=\"margin:0; padding:0; font-family:'Segoe UI',SUWR,Verdana,sans-serif; font-size:10px; line-height:14px; color:#6b6b6b; letter-spacing:-0.01em\">\r\nYou are receiving this email because you have subscribed to Microsoft Office 365.\r\n</p>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td bgcolor=\"#f0f0f0\" align=\"left\" class=\"mobile-side-padding-20\" style=\"font-family:'Segoe UI',SUWR,Verdana,sans-serif; font-size:10px; line-height:14px; color:#6b6b6b; padding- padding- padding-right:20px; text-align:left; letter-spacing:-0.01em\">\r\n<p style=\"margin:0; padding:0; font-family:'Segoe UI',SUWR,Verdana,sans-serif; font-size:10px; line-height:14px; color:#6b6b6b; letter-spacing:-0.01em\">\r\n<a target=\"_blank\" href=\"http://go.microsoft.com/fwlink/?LinkId=521839\" style=\"color:#6b6b6c; text-decoration:underline\"><strong style=\"font-weight:normal; color:#6b6b6c; text-decoration:underline\">Privacy Statement.</strong></a>\r\n</p>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td bgcolor=\"#f0f0f0\" align=\"left\" class=\"mobile-side-padding-20\" style=\"font-family:'Segoe UI',SUWR,Verdana,sans-serif; font-size:10px; line-height:14px; color:#6b6b6b; padding- padding- padding-right:20px; text-align:left; letter-spacing:-0.01em\">\r\n<p style=\"margin:0; padding:0; font-family:'Segoe UI',SUWR,Verdana,sans-serif; font-size:10px; line-height:14px; color:#6b6b6b; letter-spacing:-0.01em\">\r\nMicrosoft Corporation, One Microsoft Way, Redmond, WA 98052 USA </p>\r\n</td>\r\n</tr>\r\n<tr>\r\n<td align=\"left\" bgcolor=\"#f0f0f0\" style=\"padding- padding-bottom:30px; padding->\r\n<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">\r\n<tbody>\r\n<tr>\r\n<td align=\"left\" bgcolor=\"#f0f0f0\"><img alt=\"Microsoft\" src=\"https://asgcdn.blob.core.windows.net/office-email-templates/logo_microsoft.png\" width=\"99\" height=\"21\" style=\"display:block; outline:none; border:none\"></td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</td>\r\n</tr>\r\n</tbody>\r\n</table>\r\n</div>\r\n<p></p>\r\n</body>\r\n</html>\r\n"
            },

您可以从中获取电子邮件。请随时提出任何问题。期待收到您的回复。

You can get email message from that. Please feel free to ask any questions. Looking forward to hearing from you.

最诚挚的问候,

Yuki


这篇关于如何使用Microsoft Graph API获取整个msg文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆