我们正在尝试从EWS转换为Microsoft Graph API,我看到基本的"schema extensions"
与api:GET -
https://graph.microsoft.com/v1.0/me/messages
回复是:
{
"value": [
{
"receivedDateTime": "datetime-value",
"sentDateTime": "datetime-value",
"hasAttachments": true,
"subject": "subject-value",
"body": {
"contentType": "",
"content": "content-value"
},
"bodyPreview": "bodyPreview-value"
}
]
}
在提问后:
Add custom headers and retrieive custom header using Microsoft Graph API
我想在下图中插入一些像EWS协议的标题:
P.S:
我在测试版中看到它是可能的:
我怎样才能完全做到?
答案 0 :(得分:2)
internetMessageHeaders
属性是只读的。您不能直接通过Graph在传出消息上设置任意标题。
使用EWS,您必须在InternetHeaders
属性集中设置扩展属性。你可以通过图表使用singleValueLegacyExtendedProperties进行一些挖掘:)。
首先,我们需要InternetHeaders
属性集的GUID。从MS-OXPROPS开始,该值为00020386-0000-0000-C000-000000000046
。因此,按照create a single-value extended property的说明,我们提出了一个属性ID:
String {00020386-0000-0000-C000-000000000046} Name X-MY-COMPANY-INVOICE
现在我可以修改J POST有效负载I POST到/sendMail
端点,以包含带有值的属性:
{
"message": {
"subject": "Meet for lunch?",
"body": {
"contentType": "Text",
"content": "The new cafeteria is open."
},
"toRecipients": [
{
"emailAddress": {
"address": "adelev@contoso.com"
}
}
],
"singleValueExtendedProperties": [
{
"id": "String {00020386-0000-0000-C000-000000000046} Name X-MY-COMPANY-INVOICE",
"value": "This is my value that I put here. Isn't it neat?"
}
]
}
}