<?php

require 'vendor/autoload.php';  // Guzzle veya başka bir HTTP kütüphanesinin autoload dosyasını dahil edin

// Azure uygulama ayarları
$client_id = 'your_client_id';
$client_secret = 'your_client_secret';
$tenant_id = 'your_tenant_id';

// Microsoft Graph API endpoint
$graph_endpoint = 'https://graph.microsoft.com/v1.0';

// OAuth 2.0 için token alma URL'si
$token_url = "https://login.microsoftonline.com/$tenant_id/oauth2/v2.0/token";

// Token alma için HTTP isteği
$response = \Httpful\Request::post($token_url)
    ->body([
        'grant_type' => 'client_credentials',
        'client_id' => $client_id,
        'client_secret' => $client_secret,
        'scope' => 'https://graph.microsoft.com/.default'
    ])
    ->send();

$access_token = $response->body->access_token;

// Toplantı oluşturma için HTTP isteği
$meeting_response = \Httpful\Request::post("$graph_endpoint/meetings")
    ->body([
        'startDateTime' => '2023-01-01T08:00:00',
        'endDateTime' => '2023-01-01T09:00:00',
        // Diğer toplantı parametreleri
    ])
    ->addHeader('Authorization', 'Bearer ' . $access_token)
    ->send();

// Oluşturulan toplantının bilgilerini $meeting_response'dan alabilirsiniz
$meeting_info = $meeting_response->body;

// Toplantı bağlantısı gibi bilgileri kullanıcıyla paylaşabilirsiniz
var_dump($meeting_info);

?>
