Hey Guys i try to using MsGraph for doing some administrative work. its work for more than 4-5 month ago but when i try to get back to my code i even cant access the simple API call and returning error 400
but when i try to access my own (/me) it can return the correct result 200(ok)
but when i try to use /users/testaccount@mydomian.com its returning 400
its using PHP with Laravel.
this the source code
public function Gettest()
{
$viewData = $this->loadViewData();
// Get the access token from the cache
$tokenCache = new TokenCache();
$accessToken = $tokenCache->getAccessToken();
$graph = new Graph();
$graph->setAccessToken($accessToken);
//$user = $graph->createRequest("GET", "/me") //<-- This One Works
$user = $graph->createRequest("GET ", "/users/testaccount@mydomian.com") //NOT WORK
->addHeaders(array("Content-Type" => "application/json"))
->setReturnType(Model\User::class)
->execute();
dd($user);
}
this an example code taken from
https://learn.microsoft.com/en-us/graph/api/user-get?view=graph-rest-1.0&tabs=http
i also do the double check and already unlock the admin consent and permission required.
is there any thing that i do wrong?. because is almost on production then suddenly. it doesn't work even for the simplest API call from the documentation.