Microsoft 365 API:将联系人附加到广告系列响应时出现问题 [英] Microsoft 365 API : Issue at attaching Contact to Campaign Response
问题描述
我正在尝试在广告系列回复中添加联系人.
I am trying to attach a contact to campaign response.
我正在为此使用rest API.
I am using rest API for that.
发布数据:
{
"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 itsactivityid
(everyCampaignResponse
is anActivity
) - Finally, you need to create a new
ActivityParty
, that will link theContact
to theCampaignResponse
.
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屋!