Microsoft Dynamics crm api-在帐户下创建联系人

Microsoft Dynamics crm api-Create contact under account

正在尝试使用 api 在 Microsoft Dynamics crm 中创建联系人。

请求url是https://alliedmodulartemp.api.crm.dynamics.com/api/data/v9.1/contacts

创建联系人时想在帐户下设置联系人(即)想设置_parentcustomerid_value。

尝试使用以下格式:

URL:https://alliedmodulartemp.api.crm.dynamics.com/api/data/v9.1/contacts(POST)
input:
{
  "firstname":"alrinmyjammy",
 "emailaddress1":"leonmyjamkutty@gmail.com",
 "_parentcustomerid_value@odata.bind": "/accounts(a5f68843-ec4b-ea11-a812-000d3a579ca8)"

 }
input:
{
  "firstname":"alrinmyjammy",
 "emailaddress1":"leonmyjamkutty@gmail.com",
 "parentcustomerid@odata.bind": "/accounts(a5f68843-ec4b-ea11-a812-000d3a579ca8)"

 }

但是错误是,

An error occurred while validating input parameters: Microsoft.OData.ODataException: A property '_parentcustomerid_value' which only has property annotations in the payload but no property value is declared to be of type 'Edm.Guid'. In OData, only navigation properties and named streams can be represented as properties without values.

您的 body 应该如下所示。我刚刚用我的一个 CRM 实例进行了测试,对我来说效果很好。 url 正确 https://alliedmodulartemp.api.crm.dynamics.com/api/data/v9.1/contacts

{
    "firstname": "Test 2 Postman",
    "lastname": "Test 2 Postman",
    "parentcustomerid_account@odata.bind":"/accounts(22B474B7-4F44-E111-8C06-1CC1DEE8BACD)"
}