在php中获取Sharepoint数据列表

在php中获取Sharepoint数据列表,php,apache,sharepoint,Php,Apache,Sharepoint,我试图用php获取SharePoint列表。下面是代码 require\u once\uuuuu DIR\uuuuuuu.'\Faker master\src\autoload.php'//伪造者图书馆(https://github.com/fzaninotto/Faker) 需要一次'lib/SPOClient.php'; $username='aaaa。aaa@microsoft.com'; $password='********'; $url=”https://microsoft.sha

我试图用php获取SharePoint列表。下面是代码

require\u once\uuuuu DIR\uuuuuuu.'\Faker master\src\autoload.php'//伪造者图书馆(https://github.com/fzaninotto/Faker)
需要一次'lib/SPOClient.php';
$username='aaaa。aaa@microsoft.com';
$password='********';
$url=”https://microsoft.sharepoint.com";
generateContacts($url、$username、$password);
函数generateContacts($url、$username、$password){
$client=new-SPOClient($url);
$client->sign($username,$password);
$list=$client->getList('ClientMaster');
$contactsCount=120;
对于($i=0;$i<$contactsCount;$i++){
$contactEntry=createContactEntry();
$item=$list->addItem($contactEntry);
打印“联系人“{$item->Title}”已成功创建。\r\n”;
}
}

O/p:

致命错误:未捕获异常“exception”,消息为“无效STS请求”在E:\Apps\xampp\htdocs\ep\lib\SPOClient.php:260堆栈跟踪:#0 E:\Apps\xampp\htdocs\ep\lib\SPOClient.php(242):SPOClient->processToken('requestToken('ssss.kkkk…','*****'))#2e:\Apps\xampp\htdocs\ep\listexamples.php(24):SPOClient->sign('ssss.kkk…,'*****')3e:\Apps\xampp\htdocs\php:(“…”、“sssss.kkk…”、“*****”)#4{main}在第260行的E:\Apps\xampp\htdocs\ep\lib\SPOClient.php中抛出

require_once __DIR__ . '\Faker-master\src\autoload.php';  //Faker library       (https://github.com/fzaninotto/Faker)

require_once 'lib/SPOClient.php';



$username = 'aaaa.aaa@microsoft.com';
$password = '*******';
$url = "https://microsoft.sharepoint.com";



generateContacts($url,$username,$password);


function generateContacts($url,$username,$password){



$client = new SPOClient($url);

$client->signIn($username,$password);



$list = $client->getList('ClientMaster');

$contactsCount = 120;

for($i = 0; $i < $contactsCount; $i++){

     $contactEntry = createContactEntry();    

     $item = $list->addItem($contactEntry);

     print "Contact '{$item->Title}' has been created succesfully.\r\n";

  }