Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 general forum

Create a 'Campaignresponse' via Web API

Posted on by Microsoft Employee

Hi folks, 

I am quite desperate right now. I am trying to create a campaignresponse and can't make any progress for the last two days. 
I have a campaign and I have a contact.

I am committing the following JSON via POST to /campaignresponses 

{
"regardingobjectid_campaign@odata.bind":"\/campaigns(c2745f4a-37ac-e811-a2d2-0050569b24fe)",
"campaignresponse_activity_parties":[
{
"partyid_contact@odata.bind":"\/contacts(74a12eb5-96ab-e811-a2d2-0050569b24fe)",
"participationtypemask":11
}
]
}

What I get in Return is "Object reference not set to an instance of an object."
Any help is appreciated very much. 

best regards, 
Thomas

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Create a 'Campaignresponse' via Web API

    Glad it is finally resolved :)

    Please marke the suggests as helpful if it helped you and close the thread.

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Create a 'Campaignresponse' via Web API

    there was a custom-check in the crm when inserting a new entry. 

    this entry had an error and this caused the error message. 

  • Arun Vinoth Profile Picture
    Arun Vinoth 11,613 on at
    RE: Create a 'Campaignresponse' via Web API

    What implementation error? Share it here so that it helps someone.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Create a 'Campaignresponse' via Web API

    Just to let you know.

    The JSON was right from the beginning.

    There was an implementation error in the CRM.

    thx for all the help thoug

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Create a 'Campaignresponse' via Web API

    Hi,

    Rest builder is the managed solution which you will import in your crm and it will be visible on browser once installed. You can use teh below links (sorry it was broken) -

    carldesouza.com/dynamics-crm-rest-builder

    www.toplinestrategies.com/.../crm-rest-builder-useful-tool-working-crm-2016’s-web-api

    Hope this helps.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Create a 'Campaignresponse' via Web API

    Thanks for the tip. The Rest Builder has to run on the machine with the CRM right? Unfortunately I do not have access to said machine.

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Create a 'Campaignresponse' via Web API

    Hi,

    Please use CRM Rest Builder to build the WEB API request. This is the easiest way to build the query as well as execute it and see the results.

    www.toplinestrategies.com/.../crm-rest-builder-useful-tool-working-crm-2016’s-web-api

    You can download the tool here- github.com/.../releases

    Hope this helps.

  • Suggested answer
    Arun Vinoth Profile Picture
    Arun Vinoth 11,613 on at
    RE: Create a 'Campaignresponse' via Web API

    Looks like you are using both forward & backward slash. Check that. You can use CRM Rest builder to avoid such issues.

    Refer my answer in Stackoverflow:

    [View:https://stackoverflow.com/a/50181717/7920473]

  • Dynamics365 Rocker Profile Picture
    Dynamics365 Rocker 7,755 on at
    RE: Create a 'Campaignresponse' via Web API

    Hope below post may help you:

    community.dynamics.com/.../243456

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Create a 'Campaignresponse' via Web API

    Thanks for your fast answer.

    We have got the following:

    "regardingobjectid_campaign@odata.bind":"\/campaigns(c2745f4a-37ac-e811-a2d2-0050569b24fe)",

    The ID is a valid one.

    Do you have an example what the JSON should look like?

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... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans