Microsoft 365 API:将联系人附加到广告系列响应时出现问题 [英] Microsoft 365 API : Issue at attaching Contact to Campaign Response

查看:44
本文介绍了Microsoft 365 API:将联系人附加到广告系列响应时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在广告系列回复中添加联系人.

I am trying to attach a contact to campaign response.

我正在为此使用rest API.

I am using rest API for that.

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

发布数据:

{
  "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)"
}

这是我的JSON.

我收到错误:必须提供作为RegardingObject的广告系列" .没有联系,就可以正常工作.

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

推荐答案

我遇到了同样的问题,文档也不是很清楚,我不得不检查 CampaignResponse 中的所有关系为了了解如何解决这个问题.

I had the same problem and the documentation is not very clear about it, I had to check all the relationships of the CampaignResponse in order to understand how to solve this.

如果要创建链接到 Campaign Contact CampaignResponse ,则需要执行以下操作:

If you want to create a CampaignResponse linked to both a Campaign and a Contact you need to do the following:

  • 在发送的参数中使用"regardingobjectid_campaign@odata.bind" 创建一个 CampaignResponse .

POST "https://some_subdomain.crm6.dynamics.com/api/data/v9.0/campaignresponses"
    {
      "regardingobjectid_campaign@odata.bind": "/campaigns(CAMPAIGN_ID_HERE)",
      "description": "some desc",
      "subject": "some subject "
    }

  • 然后找到您刚刚创建的 CampaignResponse 以获得其 activityid (每个 CampaignResponse 都是 Activity )
  • 最后,您需要创建一个新的 ActivityParty ,该链接会将 Contact CampaignResponse 链接.
  • Then find the CampaignResponse you just created to get its activityid (every CampaignResponse is an Activity)
  • Finally, you need to create a new ActivityParty, that will link the Contact to the CampaignResponse.

POST "https://some_subdomain.crm6.dynamics.com/api/data/v9.0/campaignresponses(CAMPAIGN_ID_HERE)/activitypointer_activity_parties"
{
  "partyid_contact@odata.bind": "/contacts(CONTACT_ID_HERE)",
  "participationtypemask": 11 //this is the code for customers
}

这篇关于Microsoft 365 API:将联系人附加到广告系列响应时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆