_HiStOrY_V2_
config('app.url')\040.\040'/api/azure/webhook-msgraph/users'
config('app.url')\040.\040'/api/azure/webhook-msgraph/refresh-subscription'
config('external.azure.group_object_id')
$tokenRequestContext\040=\040new\040\134Microsoft\134Kiota\134Authentication\134Oauth\134ClientCredentialContext(\012\040\040\040\040\040\040\040\040\040\040\040\040config('external.azure.tenant_id'),\012\040\040\040\040\040\040\040\040\040\040\040\040config('external.azure.client_id'),\012\040\040\040\040\040\040\040\040\040\040\040\040config('external.azure.client_secret')\012\040\040\040\040\040\040\040\040);
$graphServiceClient\040=\040new\040\134Microsoft\134Graph\134GraphServiceClient($tokenRequestContext);
$groupObjectId\040=\040config('external.azure.group_object_id');
$expirationDateTime\040=\040new\040\134DateTime();
$expirationDateTime->modify('+3\040days');
$requestBody\040=\040new\040Subscription();
$requestBody\040=\040new\040\134Microsoft\134Graph\134Generated\134Models\134Subscription();
$requestBody->setChangeType('created,updated,deleted');
$requestBody->setNotificationUrl(config('app.url')\040.\040'/api/azure/webhook-msgraph/groups');
$requestBody->setLifecycleNotificationUrl(config('app.url')\040.\040'/api/azure/webhook-msgraph/refresh-subscription');
$requestBody->setResource("/groups/"\040.\040$groupObjectId\040.\040"/members");
$requestBody->setExpirationDateTime($expirationDateTime);
$graphServiceClient->subscriptions()->post($requestBody)->wait();
