Marcar mensagens como lidas
curl --request POST \
--url https://api.wppfy.com/message/markread \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"id": [
"62AD1AD844E518180227BF68DA7ED710",
"ECB9DE48EB41F77BFA8491BFA8D6EF9B"
]
}
'import requests
url = "https://api.wppfy.com/message/markread"
payload = { "id": ["62AD1AD844E518180227BF68DA7ED710", "ECB9DE48EB41F77BFA8491BFA8D6EF9B"] }
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: ['62AD1AD844E518180227BF68DA7ED710', 'ECB9DE48EB41F77BFA8491BFA8D6EF9B']})
};
fetch('https://api.wppfy.com/message/markread', 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/markread",
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' => [
'62AD1AD844E518180227BF68DA7ED710',
'ECB9DE48EB41F77BFA8491BFA8D6EF9B'
]
]),
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/markread"
payload := strings.NewReader("{\n \"id\": [\n \"62AD1AD844E518180227BF68DA7ED710\",\n \"ECB9DE48EB41F77BFA8491BFA8D6EF9B\"\n ]\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/markread")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": [\n \"62AD1AD844E518180227BF68DA7ED710\",\n \"ECB9DE48EB41F77BFA8491BFA8D6EF9B\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/message/markread")
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\": [\n \"62AD1AD844E518180227BF68DA7ED710\",\n \"ECB9DE48EB41F77BFA8491BFA8D6EF9B\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"message_id": "62AD1AD844E518180227BF68DA7ED710",
"status": "success"
},
{
"message_id": "ECB9DE48EB41F77BFA8491BFA8D6EF9B",
"status": "error",
"error": "Message not found"
}
]
}{
"error": "Missing Id in Payload"
}Ações na mensagem e Buscar
Marcar mensagens como lidas
Marca uma ou mais mensagens como lidas. Este endpoint permite:
- Marcar múltiplas mensagens como lidas de uma vez
- Atualizar o status de leitura no WhatsApp
- Sincronizar o status de leitura entre dispositivos
Exemplo de requisição básica:
{
"id": [
"62AD1AD844E518180227BF68DA7ED710",
"ECB9DE48EB41F77BFA8491BFA8D6EF9B"
]
}
Exemplo de resposta:
{
"success": true,
"message": "Messages marked as read",
"markedMessages": [
{
"id": "62AD1AD844E518180227BF68DA7ED710",
"timestamp": 1672531200000
},
{
"id": "ECB9DE48EB41F77BFA8491BFA8D6EF9B",
"timestamp": 1672531300000
}
]
}
Parâmetros disponíveis:
- id: Lista de IDs das mensagens a serem marcadas como lidas
Erros comuns:
- 401: Token inválido ou expirado
- 400: Lista de IDs vazia ou inválida
- 404: Uma ou mais mensagens não encontradas
- 500: Erro ao marcar mensagens como lidas
POST
/
message
/
markread
Marcar mensagens como lidas
curl --request POST \
--url https://api.wppfy.com/message/markread \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"id": [
"62AD1AD844E518180227BF68DA7ED710",
"ECB9DE48EB41F77BFA8491BFA8D6EF9B"
]
}
'import requests
url = "https://api.wppfy.com/message/markread"
payload = { "id": ["62AD1AD844E518180227BF68DA7ED710", "ECB9DE48EB41F77BFA8491BFA8D6EF9B"] }
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: ['62AD1AD844E518180227BF68DA7ED710', 'ECB9DE48EB41F77BFA8491BFA8D6EF9B']})
};
fetch('https://api.wppfy.com/message/markread', 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/markread",
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' => [
'62AD1AD844E518180227BF68DA7ED710',
'ECB9DE48EB41F77BFA8491BFA8D6EF9B'
]
]),
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/markread"
payload := strings.NewReader("{\n \"id\": [\n \"62AD1AD844E518180227BF68DA7ED710\",\n \"ECB9DE48EB41F77BFA8491BFA8D6EF9B\"\n ]\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/markread")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"id\": [\n \"62AD1AD844E518180227BF68DA7ED710\",\n \"ECB9DE48EB41F77BFA8491BFA8D6EF9B\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/message/markread")
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\": [\n \"62AD1AD844E518180227BF68DA7ED710\",\n \"ECB9DE48EB41F77BFA8491BFA8D6EF9B\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"results": [
{
"message_id": "62AD1AD844E518180227BF68DA7ED710",
"status": "success"
},
{
"message_id": "ECB9DE48EB41F77BFA8491BFA8D6EF9B",
"status": "error",
"error": "Message not found"
}
]
}{
"error": "Missing Id in Payload"
}Autorizações
Corpo
application/json
Lista de IDs das mensagens a serem marcadas como lidas
Exemplo:
[ "62AD1AD844E518180227BF68DA7ED710", "ECB9DE48EB41F77BFA8491BFA8D6EF9B" ]
Resposta
Messages successfully marked as read
Show child attributes
Show child attributes
Exemplo:
[ { "message_id": "62AD1AD844E518180227BF68DA7ED710", "status": "success" }, { "message_id": "ECB9DE48EB41F77BFA8491BFA8D6EF9B", "status": "error", "error": "Message not found" } ]
