1. Go to this page and download the library: Download apility/microsoft-graph-api 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/ */
apility / microsoft-graph-api example snippets
use Microsoft\GraphAPI\Facades\GraphAPI;
$me = GraphAPI::get('/me')->json();
use Microsoft\GraphAPI\GraphAPI\Client;
use Microsoft\GraphAPI\GraphAPI\Auth\Credentials;
$credentials = new Credentials(
'<your-tenant-id>',
'<your-app-id>',
'<your-client-secret>'
);
$client = new Client($credentials);
$me = $client->get('/me');