我正在寻找一些帮助格式化 Microsoft Graph API 中的架构扩展数据。我已经能够使用此正文通过代码和图形资源管理器成功发送 Office 365 消息:
{
"message": {
"subject": "Test Subject",
"body": {
"contentType": "Text",
"content": "Test Body "
},
"toRecipients": [
{
"emailAddress": {
"address": "foo@email.com"
}
}
]
}
}
我创建了一个架构扩展并将其提升为“可用”状态。我可以查询扩展以验证它是否可用并获取此响应正文:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#schemaExtensions",
"value": [
{
"id": "extc5bnq6uk_TestExtension",
"description": "Test Extension",
"targetTypes": [
"Message"
],
"status": "Available",
"owner": "mysecretclienttenantgoeshere",
"properties": [
{
"name": "ValueOne",
"type": "String"
},
{
"name": "ValueTwo",
"type": "String"
}
]
}
]
}
到目前为止,我还无法将扩展数据附加到新消息中。我试过像这样格式化我的请求正文:
{
"message": {
"subject": "Test Subject",
"body": {
"contentType": "Text",
"content": "Test Body "
},
"toRecipients": [
{
"emailAddress": {
"address": "foo@email.com"
}
}
],
"extc5bnq6uk_TestExtension": {
"ValueOne": "TestValue",
"ValueTwo": "TestValue"
}
}
}
像这样:
{
"message": {
"subject": "Test Subject",
"body": {
"contentType": "Text",
"content": "Test Body "
},
"toRecipients": [
{
"emailAddress": {
"address": "foo@email.com"
}
}
],
"extensions":[
{
"extc5bnq6uk_TestExtension" : {
"ValueOne" : "TestValue"
"ValueTwo" : "TestValue"
}
}
]
}
我在图表资源管理器中发布到这个 URL:
https://graph.microsoft.com/v1.0/me/sendMail
以及代码中的“messages”和“sendMail”端点。
慕仙森
慕斯709654
相关分类