Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- $client = new SPOClient($url);
- $client->signIn($username,$password);
- echo 'You have authenticated successfullyn';
- }
- catch (Exception $e) {
- echo 'Connection failed: ', $e->getMessage(), "n";
- }
- require_once 'SPOClient.php';
- $username = 'username@tenant.onmicrosoft.com';
- $password = 'password';
- $url = "https://tenant.sharepoint.com/";
- createTask($url,$username,$password);
- function createTask($url,$username,$password){
- $client = new SPOClient($url);
- $client->signIn($username,$password);
- $listTitle = 'Tasks';
- $list = $client->getList($listTitle);
- $itemProperties = array('Title' => 'Order Approval', 'Body' => 'Order approval task');
- $item = $list->addItem($itemProperties);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement