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

标签 php api dynamics-crm

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

请求地址为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)"
} 

关于php - Microsoft Dynamics crm api-在账户下创建联系人,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60149333/

相关文章:

php - 删除 php mysql 中的引号

javascript - 使用jquery动态更新下拉列表

api - 获取无效的Authsub token 错误403

dynamics-crm-2011 - 未经许可的用户如何与 CRM 交互?

PHP 在 sapi/cli/php 中安装失败

php - 使用 PHP 的 FedEx Shipping API

php - 将 API JSON 响应存储在 SQL 数据库中

api - 有没有 Graph QL 浏览器?

javascript - GenerateAuthenticationHeader() 在 CRM 2013 中不起作用?

sql - 两个实体如何与 1 :N relationship related?