0

我试图访问过去工作的特定文件夹的邮件。出于某种原因传递“?”在网址被拒绝为“非法字符”在我们的API,所以我编码的“?”到“%3F”,最终的url如下所示:

https://graph.microsoft.com/v1.0/me/MailFolders/INBOX/messages?$filter=From/EmailAddress/Address eq '[email protected]' 

头部包含以下内容。

("Authorization", "Bearer " + token) 
("Content-Type", "application/json") 
("Accept", "application/json") 
("grant_type", "client_credentials") 

我正在使用Azure REST API的v1,如您所见。我无法理解发生了什么事。

收到错误。

{ 
"error": { 
"code": "BadRequest", 
"message": "Resource not found for the segment 'messages?$filter=From'.", 
"innerError": { 
"request-id": "d2e9b359-d40d-4c0a-a0a5-b4e3cf4b5ecd", 
"date": "2017-03-24T14:35:28" 
} 
} 
} 

我接受你的帮助。

回答

1

不能编码?%3F,打破它。通过这种方式进行编码,表明它不是查询参数分隔符,因此服务器正在尝试查找名为messages?$filter=From :)的段。

-1

我认为这里的问题是大写问题。

如果你看一下你在上面复制的查询,你有资本:

https://graph.microsoft.com/v1.0/me/MailFolders/INBOX/messages $过滤器= ˚F ROM/Ë mailAddress/一个 ddress EQ“警报-noreply @ mail.windowsazure.com”

当这些3个字母需要所有小写(从下面our documents样品):

GET https://graph.microsoft.com/v1.0/me/messages?$filter=from/emailAddress/address eq '[email protected]'

+0

Nah。这是不正确的。 #1。它曾经工作。 #2。我试过你的解决方案和同样的问题 – WowBow