Ich versuche, Microsoft Outlook Mail-Benutzer Profilfotos mit Microsoft 365 Graph API zu erhalten.Probleme Abrufen von Benutzerprofilbild von Microsoft Outlook-Konto über Microsoft Graph 365-API in PHP
Ich habe die folgenden Berechtigungen festgelegt User.Read, User.ReadWrite, User.ReadBasic.All, User.Read.All, User.ReadWrite.All auf den Apps Enden aber seine keine Profil-Fotos während der Anzeige Benutzer Profil Fotos bereits auf ihrem Outlook Mail-Konto hochgeladen ....
Unten ist der Code
<?php
session_start();
echo $acc= $_SESSION['access_token'];
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://graph.microsoft.com/v1.0/me/photo",
//CURLOPT_URL => "https://graph.microsoft.com/v1.0/me",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
//CURLOPT_CUSTOMREQUEST => "GET",
//CURLOPT_POSTFIELDS => "$data",
CURLOPT_HTTPHEADER => array(
"authorization: Bearer $acc"
),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
print_r($response);
$json = json_decode($response);
$res = $json->{'items'};
if ($err) {
echo "cURL Error #:" . $err;
} else {
//echo $response;
}
?>
Willkommen bei Stack Overflow! Da Sie ein neuer Benutzer sind, empfehle ich Ihnen, ["Wie Sie eine gute Frage stellen"] (https://stackoverflow.com/help/how-to-ask) zu lesen. Es ist nicht klar, warum diese Art von Konto dies ist (persönlich vs Arbeit/Schule) oder was für Fehler Sie bekommen. –