Obter mapeamento de todos os lids conhecidos para número de telefone
curl --request GET \
--url https://{host}/api/{session}/lids \
--header 'apikey: <api-key>'import requests
url = "https://{host}/api/{session}/lids"
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}/lids', 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}/lids",
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}/lids"
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}/lids")
.header("apikey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/lids")
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{
"lids": [
{
"lid": "12345678901234567890",
"phone": "5511999999999"
},
{
"lid": "09876543210987654321",
"phone": "5511888888888"
}
]
}
Contatos
Obter Todos os Mapeamentos de LID para Número
Obter todos os mapeamentos de LID (Local ID) para número de telefone
GET
/
api
/
{session}
/
lids
Obter mapeamento de todos os lids conhecidos para número de telefone
curl --request GET \
--url https://{host}/api/{session}/lids \
--header 'apikey: <api-key>'import requests
url = "https://{host}/api/{session}/lids"
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}/lids', 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}/lids",
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}/lids"
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}/lids")
.header("apikey", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{host}/api/{session}/lids")
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{
"lids": [
{
"lid": "12345678901234567890",
"phone": "5511999999999"
},
{
"lid": "09876543210987654321",
"phone": "5511888888888"
}
]
}
Descrição
Este endpoint retorna todos os mapeamentos conhecidos entre LIDs (Local IDs) e números de telefone. LID é um identificador local usado pelo WhatsApp para mapear contatos de forma eficiente.Parâmetros de URL
string
required
ID único da sessão autenticada
{
"lids": [
{
"lid": "12345678901234567890",
"phone": "5511999999999"
},
{
"lid": "09876543210987654321",
"phone": "5511888888888"
}
]
}
Códigos de Status
200- Mapeamentos retornados com sucesso401- Sessão não autorizada404- Sessão não encontrada
Exemplo de Uso
curl -X GET https://api.wappfy.com.br/api/my-session/lids
const session = 'my-session';
const response = await fetch(`https://api.wappfy.com.br/api/${session}/lids`);
const data = await response.json();
console.log(`Total de LIDs: ${data.lids.length}`);
data.lids.forEach(mapping => {
console.log(`LID: ${mapping.lid} -> Phone: ${mapping.phone}`);
});
import requests
session = 'my-session'
response = requests.get(f'https://api.wappfy.com.br/api/{session}/lids')
data = response.json()
print(f"Total de LIDs: {len(data['lids'])}")
for mapping in data['lids']:
print(f"LID: {mapping['lid']} -> Phone: {mapping['phone']}")
Authorizations
Sua chave de API do Wappfy (obtenha em dash.wappfy.com.br)
