I am creating a web application in php, in that I need to integrate with Dynamics 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..