如何解决LogicApps / Graph API-从共享邮箱中删除电子邮件
按标题。 虽然可以处理自己的邮箱,但我希望在LogicApps中理想地处理共享邮箱。我可以阅读电子邮件,但是我想通过删除邮件来进行清理。
Logic Apps似乎不提供该操作,除非弄错了图形api也不提供?
有人管理吗?
解决方法
为此,我编写了一个逻辑应用程序示例供您参考:
2。。然后添加“ Parse JSON”操作以解析来自第一个“ HTTP”操作的响应以获取访问令牌。
架构应为:
{
"properties": {
"access_token": {
"type": "string"
},"expires_in": {
"type": "integer"
},"ext_expires_in": {
"type": "integer"
},"token_type": {
"type": "string"
}
},"type": "object"
}
3。。在第二个“ HTTP”操作中,我通过上述步骤中的访问令牌请求所有消息。
4。之后,我们需要使用另一个“ Parse JSON”操作来解析来自“ HTTP 2”的响应。
架构应为:
{
"properties": {
"@@odata.context": {
"type": "string"
},"value": {
"items": {
"properties": {
"@@odata.etag": {
"type": "string"
},"bccRecipients": {
"type": "array"
},"body": {
"properties": {
"content": {
"type": "string"
},"contentType": {
"type": "string"
}
},"type": "object"
},"bodyPreview": {
"type": "string"
},"categories": {
"type": "array"
},"ccRecipients": {
"type": "array"
},"changeKey": {
"type": "string"
},"conversationId": {
"type": "string"
},"conversationIndex": {
"type": "string"
},"createdDateTime": {
"type": "string"
},"flag": {
"properties": {
"flagStatus": {
"type": "string"
}
},"from": {
"properties": {
"emailAddress": {
"properties": {
"address": {
"type": "string"
},"name": {
"type": "string"
}
},"type": "object"
}
},"hasAttachments": {
"type": "boolean"
},"id": {
"type": "string"
},"importance": {
"type": "string"
},"inferenceClassification": {
"type": "string"
},"internetMessageId": {
"type": "string"
},"isDeliveryReceiptRequested": {
"type": "boolean"
},"isDraft": {
"type": "boolean"
},"isRead": {
"type": "boolean"
},"isReadReceiptRequested": {
"type": "boolean"
},"lastModifiedDateTime": {
"type": "string"
},"parentFolderId": {
"type": "string"
},"receivedDateTime": {
"type": "string"
},"replyTo": {
"type": "array"
},"sender": {
"properties": {
"emailAddress": {
"properties": {
"address": {
"type": "string"
},"sentDateTime": {
"type": "string"
},"subject": {
"type": "string"
},"toRecipients": {
"items": {
"properties": {
"emailAddress": {
"properties": {
"address": {
"type": "string"
},"name": {
"type": "string"
}
},"type": "object"
}
},"required": [
"emailAddress"
],"type": "object"
},"type": "array"
},"webLink": {
"type": "string"
}
},"required": [
"@@odata.etag","id","createdDateTime","lastModifiedDateTime","changeKey","categories","receivedDateTime","sentDateTime","hasAttachments","internetMessageId","subject","bodyPreview","importance","parentFolderId","conversationId","conversationIndex","isDeliveryReceiptRequested","isReadReceiptRequested","isRead","isDraft","webLink","inferenceClassification","body","sender","from","toRecipients","ccRecipients","bccRecipients","replyTo","flag"
],"type": "object"
},"type": "array"
}
},"type": "object"
}
5。。然后使用“ For Each”并从“ Parse JSON 2”中循环value
。
6。。在“对于每个”中,我们需要添加第三个“ HTTP”操作,如下图所示:
7。。运行逻辑应用程序,它将删除共享邮箱中的所有邮件。
顺便说一句:
在运行逻辑应用程序之前,您需要在天蓝色的广告应用程序注册中搜索client_id
,以找到该应用程序并为其添加Mail.ReadWrite
权限。另外,请不要忘记授予管理员同意。
自update on 6th May 2020起,这已经成为可能。现在,许多操作都支持一个Original Mailbox Address
可选参数,您可以将其设置为访问共享邮箱:
从2020年5月6日开始,通过可选的“邮箱地址”参数为某些操作添加了共享邮箱支持,从而允许您指定共享邮箱地址以供操作访问。
删除电子邮件(V2)操作支持以下参数:
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。