Deploy: 2026-05-22 00:33:59
This commit is contained in:
@@ -27,6 +27,27 @@ $healthHttpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
|||||||
$healthError = curl_error($ch);
|
$healthError = curl_error($ch);
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
|
||||||
|
// Test message sending endpoint to see what response it gives (404, 403, etc)
|
||||||
|
$sendUrl = $gatewayUrl . '/api/messages/send';
|
||||||
|
$payload = json_encode([
|
||||||
|
'session_key' => 'mock_test_session',
|
||||||
|
'phone' => '1234567890',
|
||||||
|
'message' => 'test'
|
||||||
|
]);
|
||||||
|
$ch = curl_init($sendUrl);
|
||||||
|
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, 5);
|
||||||
|
$sendResponse = curl_exec($ch);
|
||||||
|
$sendHttpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||||
|
$sendError = curl_error($ch);
|
||||||
|
curl_close($ch);
|
||||||
|
|
||||||
echo json_encode([
|
echo json_encode([
|
||||||
'env' => [
|
'env' => [
|
||||||
'WHATSAPP_GATEWAY_URL' => getenv('WHATSAPP_GATEWAY_URL'),
|
'WHATSAPP_GATEWAY_URL' => getenv('WHATSAPP_GATEWAY_URL'),
|
||||||
@@ -39,6 +60,12 @@ echo json_encode([
|
|||||||
'response' => json_decode($healthResponse, true) ?: $healthResponse,
|
'response' => json_decode($healthResponse, true) ?: $healthResponse,
|
||||||
'error' => $healthError
|
'error' => $healthError
|
||||||
],
|
],
|
||||||
|
'gateway_send_test' => [
|
||||||
|
'url' => $sendUrl,
|
||||||
|
'http_code' => $sendHttpCode,
|
||||||
|
'response' => json_decode($sendResponse, true) ?: $sendResponse,
|
||||||
|
'error' => $sendError
|
||||||
|
],
|
||||||
'chatbot_rules' => $rules,
|
'chatbot_rules' => $rules,
|
||||||
'messages_log' => $logs,
|
'messages_log' => $logs,
|
||||||
'whatsapp_sessions' => $sessions
|
'whatsapp_sessions' => $sessions
|
||||||
|
|||||||
Reference in New Issue
Block a user