Conectar instância ao WhatsApp
curl --request POST \
--url https://api.wppfy.com/instance/connect \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"phone": "5511999999999"
}
'import requests
url = "https://api.wppfy.com/instance/connect"
payload = { "phone": "5511999999999" }
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({phone: '5511999999999'})
};
fetch('https://api.wppfy.com/instance/connect', 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/connect",
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([
'phone' => '5511999999999'
]),
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/connect"
payload := strings.NewReader("{\n \"phone\": \"5511999999999\"\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/connect")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"5511999999999\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/instance/connect")
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 \"phone\": \"5511999999999\"\n}"
response = http.request(request)
puts response.read_body{
"connected": false,
"loggedIn": false,
"jid": null,
"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",
"delayMin": 2,
"delayMax": 4
}
}Instancia
Conectar instância ao WhatsApp
Espanhol Inicia o processo de conexão de uma instância ao WhatsApp. Este endpoint:
- Requer o token de autenticação da instância
- Recebe o número de telefone associado à conta WhatsApp
- Gera um QR code caso não passe o campo
phone - Ou Gera código de pareamento se passar o o campo
phone - Atualiza o status da instância para “connecting”
O processo de conexão permanece pendente até que:
- O QR code seja escaneado no WhatsApp do celular, ou
- O código de pareamento seja usado no WhatsApp
- Timeout de 2 minutos para QRCode seja atingido ou 5 minutos para o código de pareamento
Use o endpoint /instance/status para monitorar o progresso da conexão.
Estados possíveis da instância:
disconnected: Desconectado do WhatsAppconnecting: Em processo de conexãoconnected: Conectado e autenticado
Exemplo de requisição:
{
"phone": "5511999999999"
}
POST
/
instance
/
connect
Conectar instância ao WhatsApp
curl --request POST \
--url https://api.wppfy.com/instance/connect \
--header 'Content-Type: application/json' \
--header 'token: <api-key>' \
--data '
{
"phone": "5511999999999"
}
'import requests
url = "https://api.wppfy.com/instance/connect"
payload = { "phone": "5511999999999" }
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({phone: '5511999999999'})
};
fetch('https://api.wppfy.com/instance/connect', 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/connect",
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([
'phone' => '5511999999999'
]),
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/connect"
payload := strings.NewReader("{\n \"phone\": \"5511999999999\"\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/connect")
.header("token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"phone\": \"5511999999999\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wppfy.com/instance/connect")
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 \"phone\": \"5511999999999\"\n}"
response = http.request(request)
puts response.read_body{
"connected": false,
"loggedIn": false,
"jid": null,
"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",
"delayMin": 2,
"delayMax": 4
}
}Autorizações
Corpo
application/json
Número de telefone no formato internacional (ex: 5511999999999)
Pattern:
^\d{10,15}$Exemplo:
"5511999999999"
Resposta
Sucesso
Estado atual da conexão
Exemplo:
false
Estado do login
Exemplo:
false
ID do WhatsApp (quando logado)
Exemplo:
null
Detalhes completos da instância
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",
"delayMin": 2,
"delayMax": 4
}
