我PHP创建Web应用程序,因为我需要用动态CRM 2015年内部部署的API集成。目前我们的CRM没有使用任何身份验证(不使用ADFS)。我有以下代码返回给我一些XML /数组。但我不确定这是否是预期产出。它仅返回'OrganizationData.svc'。如何使用PHP动态CRM 2015年内部部署API集成,建立潜在客户
// 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);
微软给了API创建:https://msdn.microsoft.com/en-us/library/mt770366.aspx和retrive:https://msdn.microsoft.com/en-us/library/mt607871.aspx。但我很困惑,我该如何使用它?
可有人请帮助我。我是API整合的新手。非常感谢..
请参阅此链接。 [此链接答案](http://stackoverflow.com/questions/41215067/trying-to-create-lead-in-dynamic-crm-using-api-in-php?noredirect=1#comment69630624_41215067) – User27