curl --request GET \
--url https://{host}/api/{session}/chats/{chatId}/messages/{messageId} \
--header 'apikey: <api-key>'import requests
url = "https://{host}/api/{session}/chats/{chatId}/messages/{messageId}"
headers = {"apikey": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {apikey: '<api-key>'}};
fetch('https://{host}/api/{session}/chats/{chatId}/messages/{messageId}', 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://{host}/api/{session}/chats/{chatId}/messages/{messageId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: <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"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/{session}/chats/{chatId}/messages/{messageId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{host}/api/{session}/chats/{chatId}/messages/{messageId}")
.header("apikey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/chats/{chatId}/messages/{messageId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA",
"timestamp": 1666943582,
"from": "5511999999999@c.us",
"fromMe": true,
"source": "api",
"to": "5511999999999@c.us",
"participant": "<string>",
"body": "<string>",
"hasMedia": true,
"ack": -1,
"ackName": "<string>",
"media": {
"url": "http://localhost:3000/api/files/false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA.oga",
"mimetype": "audio/jpeg",
"filename": "example.pdf",
"s3": {
"Bucket": "my-bucket",
"Key": "default/false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA.oga"
},
"error": null
},
"author": "<string>",
"location": {
"latitude": "<string>",
"longitude": "<string>",
"description": "<string>"
},
"vCards": [
"<string>"
],
"_data": {},
"replyTo": {
"id": "AAAAAAAAAAAAAAAAAAAA",
"participant": "5511999999999@c.us",
"body": "Hello!",
"_data": {}
}
}Obter Mensagem Específica
O parâmetro deve ser o instanceName da sessão.
curl --request GET \
--url https://{host}/api/{session}/chats/{chatId}/messages/{messageId} \
--header 'apikey: <api-key>'import requests
url = "https://{host}/api/{session}/chats/{chatId}/messages/{messageId}"
headers = {"apikey": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {apikey: '<api-key>'}};
fetch('https://{host}/api/{session}/chats/{chatId}/messages/{messageId}', 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://{host}/api/{session}/chats/{chatId}/messages/{messageId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: <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"
"net/http"
"io"
)
func main() {
url := "https://{host}/api/{session}/chats/{chatId}/messages/{messageId}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("apikey", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{host}/api/{session}/chats/{chatId}/messages/{messageId}")
.header("apikey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/chats/{chatId}/messages/{messageId}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["apikey"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA",
"timestamp": 1666943582,
"from": "5511999999999@c.us",
"fromMe": true,
"source": "api",
"to": "5511999999999@c.us",
"participant": "<string>",
"body": "<string>",
"hasMedia": true,
"ack": -1,
"ackName": "<string>",
"media": {
"url": "http://localhost:3000/api/files/false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA.oga",
"mimetype": "audio/jpeg",
"filename": "example.pdf",
"s3": {
"Bucket": "my-bucket",
"Key": "default/false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA.oga"
},
"error": null
},
"author": "<string>",
"location": {
"latitude": "<string>",
"longitude": "<string>",
"description": "<string>"
},
"vCards": [
"<string>"
],
"_data": {},
"replyTo": {
"id": "AAAAAAAAAAAAAAAAAAAA",
"participant": "5511999999999@c.us",
"body": "Hello!",
"_data": {}
}
}Authorizations
Sua chave de API do Wappfy (obtenha em dash.wappfy.com.br)
Path Parameters
Nome da sessão (instanceName)
ID da Conversa
Query Parameters
Baixar mídia para mensagens
Response
ID da mensagem
"false_11111111111@c.us_AAAAAAAAAAAAAAAAAAAA"
Timestamp Unix de quando a mensagem foi criada
1666943582
ID do chat para o qual esta mensagem foi enviada
"5511999999999@c.us"
Indica se a mensagem foi enviada pelo usuário atual
The device that sent the message - either API or APP. Available in events (webhooks/websockets) only and only "fromMe: true" messages.
api, app "api"
- ID for who this message is for.
- If the message is sent by the current user, it will be the Chat to which the message is being sent.
- If the message is sent by another user, it will be the ID for the current user.
"5511999999999@c.us"
Para grupos - participante que enviou a mensagem
Conteúdo da mensagem
Indica se a mensagem possui mídia disponível para download
Status de confirmação (ACK) da mensagem
-1, 0, 1, 2, 3, 4 Nome do status de confirmação da mensagem
Objeto de mídia da mensagem, se houver e foi baixada
Show child attributes
Show child attributes
Se a mensagem foi enviada para um grupo, este campo conterá o usuário que enviou a mensagem
Informações de localização contidas na mensagem
Show child attributes
Show child attributes
Lista de vCards contidos na mensagem
Mensagem em formato bruto do WhatsApp. Pode mudar a qualquer momento, use com cautela!
Show child attributes
Show child attributes
