Configurar delay entre mensagens async
curl --request POST \
--url https://api.wppfy.com/instance/updateDelaySettings \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"msg_delay_min": 0,
"msg_delay_max": 2
}
'import requests
url = "https://api.wppfy.com/instance/updateDelaySettings"
payload = {
"msg_delay_min": 0,
"msg_delay_max": 2
}
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({msg_delay_min: 0, msg_delay_max: 2})
};
fetch('https://api.wppfy.com/instance/updateDelaySettings', 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/instance/updateDelaySettings",
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([
'msg_delay_min' => 0,
'msg_delay_max' => 2
]),
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/instance/updateDelaySettings"
payload := strings.NewReader("{\n \"msg_delay_min\": 0,\n \"msg_delay_max\": 2\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/instance/updateDelaySettings")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"msg_delay_min\": 0,\n \"msg_delay_max\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/instance/updateDelaySettings")
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 \"msg_delay_min\": 0,\n \"msg_delay_max\": 2\n}"
response = http.request(request)
puts response.read_body{
"instance": {
"id": "i91011ijkl",
"token": "abc123xyz",
"status": "connected",
"paircode": "1234-5678",
"qrcode": "data:image/png;base64,iVBORw0KGg...",
"name": "Instância Principal",
"profileName": "Loja ABC",
"profilePicUrl": "https://example.com/profile.jpg",
"isBusiness": true,
"plataform": "Android",
"systemName": "WppFy",
"owner": "user@example.com",
"lastDisconnect": "2025-01-24T14:00:00Z",
"lastDisconnectReason": "Network error",
"adminField01": "custom_data",
"openai_apikey": "sk-...xyz",
"chatbot_enabled": true,
"chatbot_ignoreGroups": true,
"chatbot_stopConversation": "parar",
"chatbot_stopMinutes": 60,
"created": "2025-01-24T14:00:00Z",
"updated": "2025-01-24T14:30:00Z",
"currentPresence": "available"
}
}{
"error": "Invalid request payload"
}{
"error": "client not found"
}{
"error": "Failed to update delay settings"
}Mensagem Async
Configurar delay entre mensagens async
Configura o intervalo de tempo entre mensagens diretas enviadas com async=true.
Detalhes
- Configuração aplicada apenas à fila interna de mensagens async
- Afeta mensagens enviadas pelos endpoints de envio com
async=true - Delay mínimo (msg_delay_min): 0 ou mais segundos (0 = sem delay)
- Delay máximo (msg_delay_max): se menor que min, será ajustado para o mesmo valor de min
- Sistema ajusta automaticamente valores negativos para 0
Exemplo
{
"msg_delay_min": 0,
"msg_delay_max": 2
}
POST
/
instance
/
updateDelaySettings
Configurar delay entre mensagens async
curl --request POST \
--url https://api.wppfy.com/instance/updateDelaySettings \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"msg_delay_min": 0,
"msg_delay_max": 2
}
'import requests
url = "https://api.wppfy.com/instance/updateDelaySettings"
payload = {
"msg_delay_min": 0,
"msg_delay_max": 2
}
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({msg_delay_min: 0, msg_delay_max: 2})
};
fetch('https://api.wppfy.com/instance/updateDelaySettings', 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/instance/updateDelaySettings",
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([
'msg_delay_min' => 0,
'msg_delay_max' => 2
]),
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/instance/updateDelaySettings"
payload := strings.NewReader("{\n \"msg_delay_min\": 0,\n \"msg_delay_max\": 2\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/instance/updateDelaySettings")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"msg_delay_min\": 0,\n \"msg_delay_max\": 2\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/instance/updateDelaySettings")
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 \"msg_delay_min\": 0,\n \"msg_delay_max\": 2\n}"
response = http.request(request)
puts response.read_body{
"instance": {
"id": "i91011ijkl",
"token": "abc123xyz",
"status": "connected",
"paircode": "1234-5678",
"qrcode": "data:image/png;base64,iVBORw0KGg...",
"name": "Instância Principal",
"profileName": "Loja ABC",
"profilePicUrl": "https://example.com/profile.jpg",
"isBusiness": true,
"plataform": "Android",
"systemName": "WppFy",
"owner": "user@example.com",
"lastDisconnect": "2025-01-24T14:00:00Z",
"lastDisconnectReason": "Network error",
"adminField01": "custom_data",
"openai_apikey": "sk-...xyz",
"chatbot_enabled": true,
"chatbot_ignoreGroups": true,
"chatbot_stopConversation": "parar",
"chatbot_stopMinutes": 60,
"created": "2025-01-24T14:00:00Z",
"updated": "2025-01-24T14:30:00Z",
"currentPresence": "available"
}
}{
"error": "Invalid request payload"
}{
"error": "client not found"
}{
"error": "Failed to update delay settings"
}Autorizações
Corpo
application/json
Resposta
Sucesso
Representa uma instância do WhatsApp
Show child attributes
Show child attributes
Exemplo:
{
"id": "i91011ijkl",
"token": "abc123xyz",
"status": "connected",
"paircode": "1234-5678",
"qrcode": "data:image/png;base64,iVBORw0KGg...",
"name": "Instância Principal",
"profileName": "Loja ABC",
"profilePicUrl": "https://example.com/profile.jpg",
"isBusiness": true,
"plataform": "Android",
"systemName": "WppFy",
"owner": "user@example.com",
"lastDisconnect": "2025-01-24T14:00:00Z",
"lastDisconnectReason": "Network error",
"adminField01": "custom_data",
"openai_apikey": "sk-...xyz",
"chatbot_enabled": true,
"chatbot_ignoreGroups": true,
"chatbot_stopConversation": "parar",
"chatbot_stopMinutes": 60,
"created": "2025-01-24T14:00:00Z",
"updated": "2025-01-24T14:30:00Z",
"currentPresence": "available"
}
