How to connect SharePoint with PHP

Reading a SharePoint List with PHP

There are so many posts you fill find on the Internet mentioning how to connect SharePoint using PHP, Some of the post will suggest you to use API's or other approaches. In this post I am going to mention all the steps to connect SharePoint using PHP.


Step- 1 - First you need to download the Thybag Api from here.

Step-2 - Download the WSDL file for the SharePoint Lists you want to interact with. This can normally be obtained at:sharepoint.url/subsite/_vti_bin/Lists.asmx?WSDL

Or you can aso put the your WSDL link directly in the Code and It will work.

https://YourDomainName.sharepoint.com/sites/YourSiteName/_vti_bin/Lists.asmx?wsdl

Also Read - How to connect Quickbooks Online using Microsoft Flow 
Also Read - How to connect Tsheets using Microsoft Flow Custom Connector

Step-3 - I have created a html file to add data into SharePoint list.



Step-4 This HTML file will send the data into spo.php file where I have added the PHP code to save Data into SharePoint List. You need to put your email and Password in the code.

$sp = new SharePointAPI('YourEmail', 'YourPassword', './Lists.asmx','SPONLINE');


OR 

You can also use the direct URL of the SharePoint List WSDL. for that you Just need to Put this code with your URL

$sp = new SharePointAPI('YourEmail', 'YourPassword', 

'https://YourDomainName.sharepoint.com/sites/YourSiteName/_vti_bin/Lists.asmx?wsdl','SPONLINE');

and then you will have to change the your Sharepoint List name (Wordpress) and their columns in this line

$sp->write('Wordpress', array('Title'=> $title, 'from'=> $from,'Body'=> $body ));





Also Read - How to connect QuickBooks online using Microsoft Flow

Step-5 - I was able to save the data in SharePoint List.




Note - If you want to read a list data or Update a List data or Delete a List Data then Please click here. and download the full project from my Gitbub.



Also Read - How to create UBUNTU VM in Miscrosoft Azure
Also Read - How to get and Set the Lookup Fields in MS Dynamics 365.
Also Read - How to change the Status (StateCode) field value in MS Dynamics 365 using JavaScript.

If you find this blog post helpful then Please share it with your friends on Social media. Thank you.