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 da mensagem"
}
'import requests
url = "https://api.wppfy.com/message/edit"
payload = {
"id": "3A12345678901234567890123456789012",
"text": "Texto editado da mensagem"
}
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 da mensagem'})
};
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 da mensagem'
]),
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 da mensagem\"\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 da mensagem\"\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 da mensagem\"\n}"
response = http.request(request)
puts response.read_body{
"id": "5511999999999:3A12345678901234567890123456789012",
"messageid": "3A12345678901234567890123456789012",
"content": "Texto editado da mensagem",
"messageTimestamp": 1704067200000,
"messageType": "text",
"status": "Pending",
"owner": "5511999999999"
}{
"error": "Invalid payload"
}{
"error": "No session"
}{
"error": "Message not found"
}{
"error": "Error fetching message from database"
}Edita uma mensagem enviada
Edita o conteúdo de uma mensagem já enviada usando a funcionalidade nativa do WhatsApp.
Use esta operação para corrigir o texto de uma mensagem enviada pela própria instância. A resposta retorna a mensagem atualizada e a alteração também aparece nos eventos configurados.
Importante:
- Só é possível editar mensagens enviadas pela própria instância
- A mensagem precisa estar disponível no histórico da instância
- O ID pode ser fornecido no formato completo retornado pela API ou apenas como
messageid - A mensagem deve estar dentro do prazo permitido pelo WhatsApp para edição
- Para newsletters/canais, 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 da mensagem"
}
'import requests
url = "https://api.wppfy.com/message/edit"
payload = {
"id": "3A12345678901234567890123456789012",
"text": "Texto editado da mensagem"
}
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 da mensagem'})
};
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 da mensagem'
]),
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 da mensagem\"\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 da mensagem\"\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 da mensagem\"\n}"
response = http.request(request)
puts response.read_body{
"id": "5511999999999:3A12345678901234567890123456789012",
"messageid": "3A12345678901234567890123456789012",
"content": "Texto editado da mensagem",
"messageTimestamp": 1704067200000,
"messageType": "text",
"status": "Pending",
"owner": "5511999999999"
}{
"error": "Invalid payload"
}{
"error": "No session"
}{
"error": "Message not found"
}{
"error": "Error fetching message from database"
}Autorizações
Corpo
ID completo retornado pela API ou apenas o messageid
"3A12345678901234567890123456789012"
Novo conteúdo de texto da mensagem
"Texto editado da mensagem"
Resposta
Mensagem editada com sucesso
ID completo da mensagem retornado pela API
"5511999999999:3A12345678901234567890123456789012"
ID da mensagem no WhatsApp
"3A12345678901234567890123456789012"
Conteúdo da mensagem editada
"Texto editado da mensagem"
Timestamp da mensagem (Unix timestamp em milissegundos)
1704067200000
Tipo da mensagem
"text"
Status da mensagem
"Pending"
Proprietário da instância
"5511999999999"
