Set a custom header with Outlook/Office 365 REST

☆樱花仙子☆ 提交于 2019-12-09 18:32:17

问题


I know it is possible to get the headers from an email with this Outlook REST, but is there a way that we can set custom headers as well? I can't seem to find any documentation.


回答1:


Try setting the SingleValueExtendedProperties on the message object. You can try using the property id for PS_INTERNET_HEADERS - {00020386-0000-0000-C000-000000000046}.

Creating a new message with a custom header might look something like this:

POST https://outlook.office.com/api/beta/me/messages

Content-Type: application/json
{
    ...,
    "SingleValueExtendedProperties": [
        {
            "PropertyId":"String {00020386-0000-0000-C000-000000000046} Name x-my-custom-header",
            "Value":"Some Value"
        }
    ]
}


来源:https://stackoverflow.com/questions/38214197/set-a-custom-header-with-outlook-office-365-rest

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