How to fetch a specific inline image using OWA REST API?

半腔热情 提交于 2020-01-14 05:34:06

问题


I'm developing OWA add-in using OWA REST API

When fetching the message item, I can see in the body if there's an inline image added which is looks like

<p style="margin-top:0; margin-bottom:0">
    <img class="EmojiInsert" src="cid:773570bf-3178-41a4-97ac-4e3eddef859f" style="">
    <br>
</p>

in the src I can see the contentId of the attachment but the resource reference did not says if this property is searchable or filterable, and I cant $select it in the odata query params, therefore I cant get that attachment!

the alternative way was to fetch the list of the attachments by doing:

https://outlook.office.com/api/v2.0/me/messages/{id}/attachments

but that will:

1- fetch all attachments with their contentBytes which is too expensive!

2- if the admin increase the minimum upload to be more than 35MB I might got error with that request i single attachment >35MB, see this question that no one answer it yet

3- I alway got some attachments that I did not upload, sometime from outlook it self (VERY WIERD) other time if I upload an attachment(s) and remove it I still get it when fetching the attachments, so some time I have for example 3 attachments but I got 12!!

Is there a way to know the inline image attachment id? and then get that attachment?

来源:https://stackoverflow.com/questions/57075314/how-to-fetch-a-specific-inline-image-using-owa-rest-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!