diff --git a/backend/public/restore_sessions.php b/backend/public/restore_sessions.php new file mode 100644 index 0000000..1078490 --- /dev/null +++ b/backend/public/restore_sessions.php @@ -0,0 +1,55 @@ + $session['session_key'], + 'webhook_url' => $appUrl . '/api/whatsapp/webhook' + ]); + + $ch = curl_init($startUrl); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); + curl_setopt($ch, CURLOPT_HTTPHEADER, [ + 'Content-Type: application/json', + 'X-Webhook-Secret: ' . getenv('WEBHOOK_SECRET') + ]); + curl_setopt($ch, CURLOPT_TIMEOUT, 10); + $res = curl_exec($ch); + $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); + curl_close($ch); + + echo "Response (HTTP {$httpCode}): {$res}\n\n"; +} + +echo "=== Sessions Restore Complete ===\n";