PHP code example of ssswang / sharepoint-graph-client
1. Go to this page and download the library: Download ssswang/sharepoint-graph-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ssswang / sharepoint-graph-client example snippets
use SharepointGraphClient\GraphSite;
$site = GraphSite::create('https://contoso.sharepoint.com/sites/team', [
'site' => [
'tenant' => '11111111-2222-3333-4444-555555555555', // Azure AD Tenant ID (GUID)
'client_id' => '00000000-0000-0000-0000-000000000000',
'secret' => 'your-client-secret',
// ...or certificate credentials instead of a secret:
// 'certificate' => [
// 'private_key' => '/path/to/key.pem', // or the PEM contents
// 'thumbprint' => 'base64url-sha1-thumbprint', // (x5t)
// ],
],
]);