Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer Service forum

Microsoft 365 API : Issue at attaching Contact to Campaign Response

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am trying to attach a contact to campaign response. 

I am using rest API for that. 

https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/campaignresponse?view=dynamics-ce-odata-9

Post Data : 
{ "firstname": "TestFirst", "lastname": "TestLast", "emailaddress": "test@test.com", "telephone": "1234567890", "prioritycode": 0, "responsecode": 1, "subject": "Test Subject", "statuscode": 1, "regardingobjectid_campaign@odata.bind": "/campaigns(xxxx90c-11ef-e811-a966-000d3ad24a0d)", "regardingobjectid_contact@odata.bind": "/contacts(xxxxfa2e-c3b5-e811-a962-000d3ad24a0d)" }


Here is my JSON.

I am getting Error :  “Campaign as RegardingObject must be supplied”. Without contact, it works fine.

Categories:
  • Suggested answer
    Ben Thompson Profile Picture
    Ben Thompson 6,350 on at
    RE: Microsoft 365 API : Issue at attaching Contact to Campaign Response

    The error message is correct - the regardingobject of a campaign response should be the campaign record (As an aside records only have a single regarding object record).

    The contact details need to go into the Customer field as a party list item see https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/activityparty-entity#ActivityPartyTypes so it looks something like

    Post Data : 
    {
      "firstname": "TestFirst",
      "lastname": "TestLast",
      "emailaddress": "test@test.com",
      "telephone": "1234567890",
      "prioritycode": 0,
      "responsecode": 1,
      "subject": "Test Subject",
      "statuscode": 1,
      "regardingobjectid_campaign@odata.bind": "/campaigns(xxxx90c-11ef-e811-a966-000d3ad24a0d)",
    "campaignresponse_activity_parties":[{
    "partyid_contact@odata.bind":"/contacts(xxxxfa2e-c3b5-e811-a962-000d3ad24a0d)",
    "participationtypemask":11
     }]
     }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,317 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans