duanfa2014 2016-12-07 00:48
浏览 42

如何使用PHP集成Dynamic CRM 2015内部部署API并创建潜在客户

I am creating a web application in php, in that I need to integrate with Dynamic CRM 2015 on-premise API. Currently our CRM not using any authentication(not using ADFS). I have the following code which returns me some xml/array. But I am not sure if this is the expected output. It is returning only 'OrganizationData.svc'.

// The host name of the on-premises dynamics instance
$host = 'crm.mycompany.com';
$organization = 'MyCompany';
$crm_url = "http://$host/$organization/";

$username = 'username';
$password = 'password';

$url = $crm_url . 'XRMServices/2011/OrganizationData.svc/SystemUserSet';
$ch = curl_init();
 $headers = array(
      'Method: GET',
      'Connection: keep-alive',
      'User-Agent: PHP-SOAP-CURL',
      'Content-Type: application/json; charset=utf-8',
      'Accept: application/json',
      'Host: ' . $host);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

$response = curl_exec($ch);

curl_close($ch);

$response=json_decode($response, true);

print_r($response);

Microsoft has given APIs to create: https://msdn.microsoft.com/en-us/library/mt770366.aspx , and retrive: https://msdn.microsoft.com/en-us/library/mt607871.aspx . but I am confused how do I use that?

Can someone please help me. I am new to API integration. Thanks a lot..

  • 写回答

1条回答 默认 最新

  • douxi4414 2016-12-08 15:21
    关注

    So the apis that you have linked to are the new web api which is different then the old 2011 enpoint which you are using in your example. The web api (if I remember correctly) is in a preview form in 2015 and is incomplete. The documentation for the 2011 endpoint which can be found here. We could never quite get an external client to authenticate to CRM so if you can figure it out please let us know. How we implemented the crm integration with some of our non-microsoft systems is we used a small asp.net page that then used the crm client tooling to communicate with CRM on behalf of that application.

    评论

报告相同问题?

悬赏问题

  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥50 我撰写的python爬虫爬不了 要爬的网址有反爬机制
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等