Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
The following examples demonstrates how to perform basic CRUD operations on SharePoint list data
require_once 'SPOClient.php';
$username = '';
$password = 'password';
$url = "";
$client = new SPOClient($url);
//Get Tasks list
$listTitle = 'Tasks';
$list = $client->getList($listTitle);
//Create a Task item
$itemProperties = array('Title' => 'Order Approval', 'Body' => 'Order approval task');
$taskItem = $list->addItem($itemProperties);
print "Task '{$taskItem->Title}' has been created succesfully.\r\n";
$itemId = $taskItem->Id;
//Update a Task item
$itemProperties = array('PercentComplete' => 1);
//Delete a Task item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment