How to integrate Microsoft Dynamics 365 CRM Common Data Service using php?

1.4k views Asked by At

I want to integrate Microsoft Dynamics 365 CRM Common Data Service using php. I want to perform CRUD of Contact entity using common data service.

Authentication I have only one option to connect with Common Data service using "ClientId or Client Secret based authentication" method. I cannot use any other authentication and authorization method.

I have followed the documentation at here but I don't find any sufficient solution.

Microsoft has given a good tutorial at here but I only have client id, client secret and url.

Is there any PHP library that I can use with client id and secret based authentication?

2

There are 2 answers

0
Saif On BEST ANSWER

After spending a day, I got the solution, which is AlexaCRM library. By using this library, I am able to connect to microsoft dynamics and perform curd opteration as well.

3
Arun Vinoth-Precog Tech - MVP On

You can find examples and libraries online, one example is this Lightweight connector library. I am not from php background, and I cannot test this myself - so you take it from here.

$RDynamics = new RDynamics(array(
    "base_url"              => "https://YOUR_CRM_INSTANCE.crm4.dynamics.com",
    "authEndPoint"          => "https://login.windows.net/common/oauth2/authorize",
    'tokenEndPoint'         => 'https://login.windows.net/common/oauth2/token',
    'crmApiEndPoint'        => 'https://YOUR_CRM_INSTANCE.api.crm4.dynamics.com/',
    "clientID"              => "***", 
    "clientSecret"          => "***", 
    'user'                  => '***',
    'pass'                  => '*'
));

Update:

Some confusion around different ways of achieving it. Read more