thybag / PHP-SharePoint-Lists-API

A simple PHP API to make working with SharePoint lists easy.
MIT License
184 stars 95 forks source link

I have problem with Read, Write, Update query #156

Open Br0wserz opened 5 years ago

Br0wserz commented 5 years ago

My problem is an generic error, i think.

`$sp = new SharePointAPI('username', 'password', 'sharepoint site', 'NTLM');

    $a = $sp->query('label')->where('docicon', '=', 'pdf')->get(); 
    $a = $sp->read('label, NULL, array('richiedente'=>'Calcagni Cristiano')); 
    $sp->update('laravel','1', array('cespite'=>'5555'));
    $sp->delete('laravel', '1');

return $a; `

When i try to refresh the page with this code the result is: Exception in SoapClientAuth.php line 129: Error

In the line 129 there is bold line below: if (($info = curl_getinfo($ch)) && $info['http_code'] == 200) { return $response; } else { if ($info['http_code'] == 401) { throw new \Exception ('Access Denied', 401); } else { if (curl_errno($ch) != 0) { throw new \Exception(curl_error($ch), curl_errno($ch)); } else { throw new \Exception('Error', $info['http_code']); }

I can read only with this general function $a = $sp->query('label')->get();

that return me a json data only

Am i doing wrong something?