您必须填充集合值导航属性email_activity_parties
以填充From
和To
字段。sender
&torecipients
是仅用于报告目的的字段,带有这些活动方的电子邮件地址。
var email = {};
email["subject"] = "Email demo from Web API";
email["description"] = "This a web api test";
email["regardingobjectid_contact@odata.bind"] = "/contacts(C41CE33F-D0A0-E611-811E-5065F38C8781)";
//activityparty collection
var activityparties = [];
//from party
var from = {};
from["partyid_systemuser@odata.bind"] = "/systemusers(8D23B2C1-9869-4C3F-9A80-BA51375C1784)";
from["participationtypemask"] = 1;
//to party
var to = {};
to["partyid_contact@odata.bind"] = "/contacts(C41CE33F-D0A0-E611-811E-5065F38C8781)";
to["participationtypemask"] = 2;
activityparties.push(to);
activityparties.push(from);
//set to and from to email
email["email_activity_parties"] = activityparties;
阅读更多
编辑:
JSON 将如下所示:
{
"subject": "Test Subject New 1234567",
"description": "Test Description New 1234567",
"regardingobjectid_contact@odata.bind": "/contacts(<GUID>)",
"email_activity_parties": [
{
"partyid_contact@odata.bind": "/contacts(<GUID>)",
"participationtypemask": 2
},
{
"partyid_systemuser@odata.bind": "/systemusers(<GUID>)",
"participationtypemask": 1
}
]
}