![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/soundstudiopro.com/private_html/utils/ |
<?php
// Test the new API integration
error_reporting(E_ALL);
ini_set('display_errors', 1);
echo "<h1>๐งช Testing New API Integration</h1>";
// Test data
$test_data = [
'customMode' => true,
'prompt' => 'A cheerful upbeat song about testing the new API integration',
'title' => 'API Test Song',
'instrumental' => false,
'model_name' => 'chirp-v3-5',
'variations' => 1,
'tags' => 'test, upbeat, cheerful',
'tempo' => '120',
'key' => 'C',
'scale' => 'major',
'energy' => 7,
'excitement' => 6,
'mood' => 'happy',
'genre' => 'Pop',
'duration' => 30
];
echo "<h2>๐ค Sending Test Request</h2>";
echo "<pre>" . json_encode($test_data, JSON_PRETTY_PRINT) . "</pre>";
// Make the API request
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://soundstudiopro.com/api.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($test_data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'User-Agent: TestClient/1.0'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
$response = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$curl_error = curl_error($ch);
curl_close($ch);
echo "<h2>๐ฅ API Response</h2>";
echo "<p><strong>HTTP Code:</strong> $http_code</p>";
if ($curl_error) {
echo "<p style='color: red;'><strong>cURL Error:</strong> $curl_error</p>";
} else {
echo "<p style='color: green;'><strong>cURL:</strong> Success</p>";
}
echo "<p><strong>Raw Response:</strong></p>";
echo "<pre style='background: #f0f0f0; padding: 10px; max-height: 400px; overflow-y: auto; border: 1px solid #ccc;'>";
echo htmlspecialchars($response);
echo "</pre>";
// Parse response
$result = json_decode($response, true);
if ($result) {
echo "<h2>๐ Parsed Response</h2>";
echo "<table border='1' style='border-collapse: collapse; margin: 20px 0;'>";
echo "<tr><th>Field</th><th>Value</th></tr>";
if (isset($result['data'])) {
foreach ($result['data'] as $key => $value) {
if (is_array($value)) {
$value = json_encode($value);
}
echo "<tr><td>$key</td><td>" . htmlspecialchars($value) . "</td></tr>";
}
} else {
foreach ($result as $key => $value) {
if (is_array($value)) {
$value = json_encode($value);
}
echo "<tr><td>$key</td><td>" . htmlspecialchars($value) . "</td></tr>";
}
}
echo "</table>";
// If we got a track_id, check its status
if (isset($result['data']['track_id'])) {
echo "<h2>๐ Check Track Status</h2>";
echo "<p><a href='/check_track_status.php?track_id={$result['data']['track_id']}' target='_blank'>Check Track Status</a></p>";
// Also check the debug page
echo "<p><a href='/debug_tracks.php' target='_blank'>View All Tracks</a></p>";
}
} else {
echo "<p style='color: red;'>โ Failed to parse JSON response</p>";
}
echo "<h3>๐ Quick Links</h3>";
echo "<p><a href='/library.php' style='color: #667eea;'>๐ View Library</a> | ";
echo "<a href='/debug_tracks.php' style='color: #667eea;'>๐ Debug Tracks</a> | ";
echo "<a href='/api.php' style='color: #667eea;'>๐ง API Endpoint</a></p>";
?>