Andrew, Bipin, thanks for the help, in the end this is what worked for me,
Requirement, API insert to phonecalls, emails and of the from/to contacts
Email:
{
"regardingobjectid_contact@odata.bind" : "/contacts($(contactDB_To.contactid))",
"subject": "$(CRM_subject)",
"description": "$(email_rs.text)",
"email_activity_parties": [
{
"participationtypemask": 1, //1 = sender/from, 2=To,3=CC,4=BCC,
"partyid_contact@odata.bind": "/contacts($(agentSearch.contactid))"
},
{
"participationtypemask": 2, //1 = sender/from, 2=To,3=CC,4=BCC,
"partyid_contact@odata.bind": "/contacts($(contactDB_To.contactid))"
}
]
}
Phonecallls:
{
"regardingobjectid_contact@odata.bind" : "/contacts($(CRM_contactid))",
"phonenumber": "$(CRM_mobilephone)",
"subject": "Outbound Call",
"directioncode": true, //true=Outbound,false=inbound
"description": "Agent Disposition: $(disposition)",
"phonecall_activity_parties": [
{
"participationtypemask": 1, //1 = from, 2=To,3=CC,4=BCC,
"partyid_contact@odata.bind": "/contacts($(agentSearch.contactid))"
},
{
"participationtypemask": 2, //1 =from, 2=To,3=CC,4=BCC,
"partyid_contact@odata.bind": "/contacts($(CRM_contactid))"
}
]
}