Files
whatsapp/scripts/test_insert_url.php
T
2026-01-21 11:04:41 -05:00

20 lines
743 B
PHP

<?php
require_once __DIR__ . '/../config/config.php';
try {
$db = Database::getInstance();
$mid = 'wamid.TEST' . rand(1000,9999);
$db->insert('conversations', [
'user_id' => 2,
'message_id' => $mid,
'direction' => 'incoming',
'message_type' => 'document',
'content' => 'usuarios_blancos.csv',
'media_url' => 'https://lookaside.fbsbx.com/whatsapp_business/attachments/?mid=1379066300634610&source=webhook&ext=1769010393&hash=EXAMPLE',
'status' => 'received'
]);
$row = $db->fetch('SELECT * FROM conversations WHERE message_id = ?', [$mid]);
echo json_encode($row, JSON_PRETTY_PRINT) . "\n";
} catch (Throwable $t) {
echo 'Error: ' . $t->getMessage() . "\n";
}