mejoras
This commit is contained in:
@@ -233,7 +233,7 @@ class WhatsAppService
|
||||
'message_id' => $messageId
|
||||
];
|
||||
|
||||
$url = $this->apiUrl . $this->phoneNumberId . '/messages';
|
||||
$url = $this->apiUrl . $this->phoneNumberId . '/conversations';
|
||||
return $this->makeRequest('POST', $url, $data);
|
||||
}
|
||||
|
||||
@@ -400,7 +400,7 @@ class WhatsAppService
|
||||
private function sendMessage($data)
|
||||
{
|
||||
// Construir URL correctamente
|
||||
$url = rtrim($this->apiUrl, '/') . '/' . $this->phoneNumberId . '/messages';
|
||||
$url = rtrim($this->apiUrl, '/') . '/' . $this->phoneNumberId . '/conversations';
|
||||
|
||||
// Debug log
|
||||
error_log("WhatsApp API URL: " . $url);
|
||||
@@ -410,7 +410,7 @@ class WhatsAppService
|
||||
$response = $this->makeRequest('POST', $url, $data);
|
||||
|
||||
// Guardar mensaje enviado en la base de datos
|
||||
if ($response && isset($response['messages'][0]['id'])) {
|
||||
if ($response && isset($response['conversations'][0]['id'])) {
|
||||
$this->saveOutgoingMessage($data, $response);
|
||||
}
|
||||
|
||||
@@ -506,7 +506,7 @@ class WhatsAppService
|
||||
if ($user) {
|
||||
$messageData = [
|
||||
'user_id' => $user['id'],
|
||||
'message_id' => $response['messages'][0]['id'],
|
||||
'message_id' => $response['conversations'][0]['id'],
|
||||
'direction' => 'outgoing',
|
||||
'message_type' => $data['type'],
|
||||
'content' => $this->extractMessageContent($data),
|
||||
|
||||
Reference in New Issue
Block a user