Creating an Email activity in MS CRM through WebApi | CloudFronts

Creating an Email activity in MS CRM through WebApi

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
        }
        ]
}


Share Story :

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close