### FILE: index.php graphCall($endpoint, $accessToken); $agentData = json_decode($response, true); // Check if data retrieval was successful if (!$agentData) { throw new Exception('Failed to retrieve agent data.'); } // Render a premium card with the agent details render_premium_card( 'Agent 365 Data', json_encode($agentData), null, 'up', '📊', null ); } catch (Exception $e) { // Handle errors echo 'Error: ' . $e->getMessage(); } ?> ### FILE: scripts/Automation.ps1 <# .SYNOPSIS Retrieves data from Agent 365 using Microsoft Graph API. .DESCRIPTION This script connects to the Microsoft Graph API and retrieves specific agent data using the new Agent 365 endpoints. .EXAMPLE ./Automation.ps1 #> try { # Connect to Microsoft Graph Connect-MgGraph -Scopes "https://graph.microsoft.com/.default" # Specify agent identifier $agentId = "YOUR_AGENT_ID" # API call to fetch the agent data $response = Invoke-RestMethod -Uri "https://graph.microsoft.com/v1.0/agent365/$agentId" -Headers @{Authorization = "Bearer $($token)"} -Method GET # Output the retrieved data Write-Host $response } catch { # Error handling Write-Error "An error occurred: $_" } <# .NOTES Author: Souhaiel Morhag Company: MSEndpoint.com Blog: https://msendpoint.com Academy: https://app.msendpoint.com/academy LinkedIn: https://linkedin.com/in/souhaiel-morhag GitHub: https://github.com/Msendpoint License: MIT #>