<?php
require_once 'TelstraAPI.php';
$api = new TelstraAPI();
$token = $api->getAccessToken();
echo "Token obtained? " . ($token ? 'Yes' : 'No') . "\n";
if ($token) {
    echo "Token length: " . strlen($token) . "\n";
    
    $chGet = curl_init();
    curl_setopt_array($chGet, [
        CURLOPT_URL => 'https://products.api.telstra.com/messaging/v3/virtual-numbers',
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => [
            'Authorization: Bearer ' . $token,
            'Accept: application/json'
        ]
    ]);
    $getResponse = curl_exec($chGet);
    $httpCode = curl_getinfo($chGet, CURLINFO_HTTP_CODE);
    echo "HTTP Code: $httpCode\n";
    echo "Response: $getResponse\n";
} else {
    echo "Auth Error: \n";
}
