curl --request GET \
--url https://api.wabox.me/instances/{instance_id}/token/{token}/contacts/{phone}/presenceconst options = {method: 'GET'};
fetch('https://api.wabox.me/instances/{instance_id}/token/{token}/contacts/{phone}/presence', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wabox.me/instances/{instance_id}/token/{token}/contacts/{phone}/presence"
response = requests.get(url)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wabox.me/instances/{instance_id}/token/{token}/contacts/{phone}/presence",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.wabox.me/instances/{instance_id}/token/{token}/contacts/{phone}/presence"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"phone": "5511988887777",
"status": "UNAVAILABLE",
"last_seen": 1786968480000,
"momment": 1786968540000
}{
"error": {
"code": "instance_not_found",
"message": "Instance not found or invalid token"
}
}{
"error": {
"code": "subscription_required",
"message": "Trial expired or subscription inactive. Subscribe in the dashboard to keep sending."
}
}{
"error": {
"code": "instance_not_connected",
"message": "Instance is not connected"
}
}Online e visto por último do contato
status é AVAILABLE (online) ou UNAVAILABLE (offline); last_seen é o visto por último (epoch ms) quando o contato o compartilha, e momment é quando o Wabox recebeu a última atualização. A primeira consulta de um contato pede ao WhatsApp para avisar as mudanças de presença dele e espera a resposta por até 3 s; as seguintes devolvem o último estado conhecido, que também chega no webhook chat_presence. Campos null: o contato oculta a presença na privacidade, não tem conversa com o número ou ainda não respondeu. O WhatsApp só envia a presença de contatos enquanto o número está online: ligue always_online nas configurações (ou use POST /send-presence com available). Executa na hora e exige a instância conectada (caso contrário, 409 instance_not_connected).
curl --request GET \
--url https://api.wabox.me/instances/{instance_id}/token/{token}/contacts/{phone}/presenceconst options = {method: 'GET'};
fetch('https://api.wabox.me/instances/{instance_id}/token/{token}/contacts/{phone}/presence', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wabox.me/instances/{instance_id}/token/{token}/contacts/{phone}/presence"
response = requests.get(url)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.wabox.me/instances/{instance_id}/token/{token}/contacts/{phone}/presence",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://api.wabox.me/instances/{instance_id}/token/{token}/contacts/{phone}/presence"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"phone": "5511988887777",
"status": "UNAVAILABLE",
"last_seen": 1786968480000,
"momment": 1786968540000
}{
"error": {
"code": "instance_not_found",
"message": "Instance not found or invalid token"
}
}{
"error": {
"code": "subscription_required",
"message": "Trial expired or subscription inactive. Subscribe in the dashboard to keep sending."
}
}{
"error": {
"code": "instance_not_connected",
"message": "Instance is not connected"
}
}Path Parameters
Id da instância (dashboard › instância › Credenciais).
Token da instância. Trate como senha.
"5511988887777"
Response
Última presença conhecida.
1^(\d{5,20}|\d+@lid|\d+(-\d+)?-group|\d+@g\.us|\d+@newsletter|\d+@broadcast|status@broadcast)$AVAILABLE, UNAVAILABLE -9007199254740991 <= x <= 9007199254740991-9007199254740991 <= x <= 9007199254740991