curl --request POST \
--url https://api.wppfy.com/message/edit \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"id": "3A12345678901234567890123456789012",
"text": "Texto editado del mensaje"
}
'import requests
url = "https://api.wppfy.com/message/edit"
payload = {
"id": "3A12345678901234567890123456789012",
"text": "Texto editado del mensaje"
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '3A12345678901234567890123456789012', text: 'Texto editado del mensaje'})
};
fetch('https://api.wppfy.com/message/edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wppfy.com/message/edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '3A12345678901234567890123456789012',
'text' => 'Texto editado del mensaje'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wppfy.com/message/edit"
payload := strings.NewReader("{\n \"id\": \"3A12345678901234567890123456789012\",\n \"text\": \"Texto editado del mensaje\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wppfy.com/message/edit")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3A12345678901234567890123456789012\",\n \"text\": \"Texto editado del mensaje\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/message/edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"3A12345678901234567890123456789012\",\n \"text\": \"Texto editado del mensaje\"\n}"
response = http.request(request)
puts response.read_body{
"id": "5511999999999:3A12345678901234567890123456789012",
"messageid": "3A12345678901234567890123456789012",
"content": "Texto editado del mensaje",
"messageTimestamp": 1704067200000,
"messageType": "text",
"status": "Pending",
"owner": "5511999999999"
}{
"error": "Payload inválido"
}{
"error": "No session"
}{
"error": "Mensaje no encontrado"
}{
"error": "Error al obtener el mensaje de la base de datos"
}Edita un mensaje enviado
Edita el contenido de un mensaje ya enviado usando la funcionalidad nativa de WhatsApp.
Utilice esta operación para corregir el texto de un mensaje enviado por la propia instancia. La respuesta devuelve el mensaje actualizado y el cambio también aparece en los eventos configurados.
Importante:
- Solo es posible editar mensajes enviados por la propia instancia
- El mensaje debe estar disponible en el historial de la instancia
- El ID puede proporcionarse en el formato completo devuelto por la API o solo como
messageid - El mensaje debe estar dentro del plazo permitido por WhatsApp para edición
- Para newsletters/canales, use
POST /newsletter/messages/edit
curl --request POST \
--url https://api.wppfy.com/message/edit \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"id": "3A12345678901234567890123456789012",
"text": "Texto editado del mensaje"
}
'import requests
url = "https://api.wppfy.com/message/edit"
payload = {
"id": "3A12345678901234567890123456789012",
"text": "Texto editado del mensaje"
}
headers = {
"token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({id: '3A12345678901234567890123456789012', text: 'Texto editado del mensaje'})
};
fetch('https://api.wppfy.com/message/edit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wppfy.com/message/edit",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'id' => '3A12345678901234567890123456789012',
'text' => 'Texto editado del mensaje'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"token: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wppfy.com/message/edit"
payload := strings.NewReader("{\n \"id\": \"3A12345678901234567890123456789012\",\n \"text\": \"Texto editado del mensaje\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.wppfy.com/message/edit")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"3A12345678901234567890123456789012\",\n \"text\": \"Texto editado del mensaje\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/message/edit")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"id\": \"3A12345678901234567890123456789012\",\n \"text\": \"Texto editado del mensaje\"\n}"
response = http.request(request)
puts response.read_body{
"id": "5511999999999:3A12345678901234567890123456789012",
"messageid": "3A12345678901234567890123456789012",
"content": "Texto editado del mensaje",
"messageTimestamp": 1704067200000,
"messageType": "text",
"status": "Pending",
"owner": "5511999999999"
}{
"error": "Payload inválido"
}{
"error": "No session"
}{
"error": "Mensaje no encontrado"
}{
"error": "Error al obtener el mensaje de la base de datos"
}Autorizaciones
Cuerpo
ID completo devuelto por la API o solo el messageid
"3A12345678901234567890123456789012"
Nuevo contenido de texto del mensaje
"Texto editado del mensaje"
Respuesta
Mensaje editado correctamente
ID completo del mensaje devuelto por la API
"5511999999999:3A12345678901234567890123456789012"
ID del mensaje en WhatsApp
"3A12345678901234567890123456789012"
Contenido del mensaje editado
"Texto editado del mensaje"
Timestamp del mensaje (Unix timestamp en milisegundos)
1704067200000
Tipo del mensaje
"text"
Estado del mensaje
"Pending"
Propietario de la instancia
"5511999999999"
