curl --request POST \
--url https://api.wppfy.com/labels/refresh \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '{
"force": false
}'import requests
url = "https://api.wppfy.com/labels/refresh"
payload = { "force": False }
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({force: false})
};
fetch('https://api.wppfy.com/labels/refresh', 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/labels/refresh",
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([
'force' => false
]),
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/labels/refresh"
payload := strings.NewReader("{\n \"force\": false\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/labels/refresh")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"force\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/labels/refresh")
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 \"force\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"request_id": "3f1c9b52-8d4e-4a7b-9c61-2f0e5d7a1b84",
"status": "started",
"message": "Label refresh started. Use GET /labels to fetch the refreshed list.",
"force": false,
"fullSync": false
}{
"error": "history sync still in progress, try again in a moment"
}{
"error": "failed to reload labels from WhatsApp"
}Iniciar recarga de etiquetas do WhatsApp
Inicia uma nova leitura das etiquetas no WhatsApp sem bloquear a requisição.
A resposta confirma apenas que a recarga foi iniciada ou que já existe uma recarga em andamento.
Para obter a lista atualizada, consulte GET /labels depois.
A recarga também atualiza as associações entre etiquetas e chats. Quando
houver mudança, o webhook chat_labels pode informar os dados atualizados.
A resposta traz um request_id, repetido nos webhooks history (labels e chat_labels) dessa recarga. Se já houver uma recarga em andamento, o request_id é o dela.
Uso recomendado:
- tente primeiro com
force=false - se isso não trouxer as etiquetas corretamente, tente
force=true - use
force=trueapenas como tentativa de correção, porque ele faz uma recarga mais pesada
curl --request POST \
--url https://api.wppfy.com/labels/refresh \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '{
"force": false
}'import requests
url = "https://api.wppfy.com/labels/refresh"
payload = { "force": False }
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({force: false})
};
fetch('https://api.wppfy.com/labels/refresh', 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/labels/refresh",
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([
'force' => false
]),
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/labels/refresh"
payload := strings.NewReader("{\n \"force\": false\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/labels/refresh")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"force\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/labels/refresh")
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 \"force\": false\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"request_id": "3f1c9b52-8d4e-4a7b-9c61-2f0e5d7a1b84",
"status": "started",
"message": "Label refresh started. Use GET /labels to fetch the refreshed list.",
"force": false,
"fullSync": false
}{
"error": "history sync still in progress, try again in a moment"
}{
"error": "failed to reload labels from WhatsApp"
}Autorizações
Corpo
Tente primeiro com false.
Use true apenas quando a recarga padrão não funcionar bem,
pois esse modo faz uma nova leitura mais completa das etiquetas.
false
Resposta
Recarga de etiquetas aceita para processamento em background
true
Identifica esta recarga nos webhooks labels e chat_labels. Usa o header X-Request-ID quando enviado.
"3f1c9b52-8d4e-4a7b-9c61-2f0e5d7a1b84"
started, in_progress "started"
"Label refresh started. Use GET /labels to fetch the refreshed list."
false
false
