Skip to main content

Notifications

Creating an Email activity in MS CRM through WebApi

Community Member Profile Picture Community Member Microsoft Employee

Introduction:

This blog explains how to Create an Email activity in MS CRM through WebApi

Request:

Post URL:  <your instance url>/api/data/v9.1/emails

Header:

Content-Type: application/json
Prefer: return=representation

Body:

1. Creating Email with resolved emails (To field of email is record in MS CRM).

{
    "description" : "Email Created",  ///Email Body
    "regardingobjectid_account@odata.bind" : "/accounts(69C38067-EDB7-E811-A961-000D3A363C81)",
    "subject" : "Test Email Creation", 
    "email_activity_parties" : [
        {
            "partyid_systemuser@odata.bind" : "/systemusers(CED2E02D-188E-4AA8-B6E2-D746E9B370C1)",
            "participationtypemask" : 1  ///From Email
        },
        {
            "partyid_account@odata.bind" : "/accounts(69C38067-EDB7-E811-A961-000D3A363C81)",
            "participationtypemask" : 2  ///To Email
        }]
}

2. Creating Email with unresolved emails (To field of email is not record in MS CRM).

{
    "description" : "Email Created",
    "regardingobjectid_account@odata.bind" : "/accounts(69C38067-EDB7-E811-A961-000D3A363C81)",
    "subject" : "Test Email Creation", 
    "email_activity_parties" : [
        {
            "partyid_systemuser@odata.bind" : "/systemusers(CED2E02D-188E-4AA8-B6E2-D746E9B370C1)",
            "participationtypemask" : 1
        },
         {
           "addressused":"vvyas@cloudfronts.com",
            "participationtypemask" : 2
        }
        ]
}

3. Creating Email with multiple unresolved emails (To field of email is not record in MS CRM).

{
    "description": "Test Email",
    "regardingobjectid_account@odata.bind": "/accounts(69C38067-EDB7-E811-A961-000D3A363C81)",
    "subject": "Update Your Phone Number", 
    "email_activity_parties": [
        {
            "partyid_systemuser@odata.bind": "/systemusers(CED2E02D-188E-4AA8-B6E2-D746E9B370C1)",
            "participationtypemask": 1
        },
        {
           "addressused":" vvyas@cloudfronts.com",
            "participationtypemask": 2
        },
         {
           "addressused":" smahato @cloudfronts.com",
            "participationtypemask": 2
        }
        ]
}

The post Creating an Email activity in MS CRM through WebApi appeared first on CloudFronts - Microsoft Dynamics 365 | Power BI | Azure.

Comments

*This post is locked for comments