Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Authenticating Microsoft Dynamics in PHP

I am trying to integrate Microsoft Dynamics Online with my website. However, I am struggling to find a decent way to authenticate via the API (whether it'd be REST or SOAP) using PHP. Most examples use the Microsoft CRM SDK (in .NET) to authenticate. However, my website is based in PHP and I would like to know how you gain access to the Microsoft Dynamics API (REST and/or SOAP).

Does anyone know a suitable way to authenticate with the Microsoft dynamics API via php?

like image 635
Jeroen Minnaert Avatar asked Feb 18 '13 19:02

Jeroen Minnaert


1 Answers

From Dynamics CRM 2016 onwards (v8.0) - we got REST API endpoint for cross platform integrations. It will look like this: https://crmorgname.crm.dynamics.com/api/data/v8.0/accounts

SOAP endpoints are deprecated, REST/JSON/Odata based CRM web api endpoint is the game changer. We can use XMLHttpRequest or any means to hit that endpoint with prompt VERB like PUT, GET or POST for our purpose.

To get authenticated - we have to use OAuth, for that we need to register the PHP app in Azure Active directory & enable the permissions for Dynamics CRM online. Once done we can use that Client ID & Client secret to get authenticated and the BEARER TOKEN can be used for API calls.

like image 191
Arun Vinoth - MVP Avatar answered Nov 09 '22 17:11

Arun Vinoth - MVP