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": "Recarga de etiquetas iniciada. Use GET /labels para obtener la lista actualizada.",
"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 de WhatsApp
Inicia una nueva lectura de las etiquetas en WhatsApp sin bloquear la solicitud.
La respuesta solo confirma que la recarga se inició o que ya existe una recarga en curso.
Para obtener la lista actualizada, consulte GET /labels después.
La recarga también actualiza las asociaciones entre etiquetas y chats. Cuando
haya cambios, el webhook chat_labels puede informar los datos actualizados.
La respuesta incluye un request_id, repetido en los webhooks history (labels y chat_labels) de esa recarga. Si ya hay una recarga en curso, el request_id es el de esa recarga.
Uso recomendado:
- intente primero con
force=false - si eso no trae las etiquetas correctamente, intente con
force=true - use
force=truesolo como intento de corrección, porque realiza una recarga más 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": "Recarga de etiquetas iniciada. Use GET /labels para obtener la lista actualizada.",
"force": false,
"fullSync": false
}{
"error": "history sync still in progress, try again in a moment"
}{
"error": "failed to reload labels from WhatsApp"
}Autorizaciones
Cuerpo
Intente primero con false.
Use true solo cuando la recarga predeterminada no funcione bien,
ya que este modo realiza una nueva lectura más completa de las etiquetas.
false
Respuesta
Recarga de etiquetas aceptada para procesamiento en segundo plano
true
Identifica esta recarga en los webhooks labels y chat_labels. Usa el header X-Request-ID cuando se envía.
"3f1c9b52-8d4e-4a7b-9c61-2f0e5d7a1b84"
started, in_progress "started"
"Recarga de etiquetas iniciada. Use GET /labels para obtener la lista actualizada."
false
false
