如何在Office 365 API上从特定电子邮件地址过滤电子邮件? [英] How can I filter emails from a specific email address on Office 365 API?

查看:125
本文介绍了如何在Office 365 API上从特定电子邮件地址过滤电子邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有成千上万的电子邮件用户,但我只需要从特定的人那里获取未读的电子邮件.我有以下电话,但对我不起作用.

I've users with thousands of emails but I need to fetch only unread emails from specific people. I have the following call but it is not working for me.

curl -i https://graph.microsoft.com/v1.0/me/messages$filter=From/EmailAddress/Address eq 'alerts-noreply@mail.windowsazure.com' H 'Content-Type: application/x-www-form-urlencoded' -H 'Authorization: Bearer token ....'

{
  "error": {
    "code": "BadRequest",
    "message": "Unsupported segment type. ODataQuery: users/020f1da4-031d-4....26513bb0/messages=From/EmailAddress/Address",
    "innerError": {
      "request-id": "2aaaaeb...42-ffc6d0e44f3d",
      "date": "2017-01-24T01:30:44"
    }
  }
}

如何从MS Office API"FROM"特定的人那里获取电子邮件而又不将所有电子邮件都获取到我们的系统?

How can I fetch emails from MS Office API "FROM" specific people without fetching all emails to our system?

推荐答案

messages之后,您缺少字符?.要过滤来自未读邮件的指定用户的邮件,可以使用以下请求:

You were missing the character ? after messages. To filter the messages from specify user with unread messages, you can use the request below:

GET:https://graph.microsoft.com/v1.0/me/messages?$filter=from/emailAddress/address+eq+'xx@xxxx.onmicrosoft.com'+and+isRead+eq+false

这篇关于如何在Office 365 API上从特定电子邮件地址过滤电子邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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