Rotacionar secret global
curl --request POST \
--url https://cloud.datafyapi.com.br/channels/whatsapp/global-webhook/rotate-secret \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cloud.datafyapi.com.br/channels/whatsapp/global-webhook/rotate-secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://cloud.datafyapi.com.br/channels/whatsapp/global-webhook/rotate-secret"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"webhook_secret": "whsec_xxx"
}{
"statusCode": 401,
"message": "Token de conta ausente ou inválido"
}{
"statusCode": 403,
"message": "Sua assinatura precisa estar ativa para usar a API. Acesse o painel para ativá-la."
}{
"statusCode": 404,
"message": "Nenhum webhook global configurado"
}Webhook global
Rotacionar secret global
Gera um novo secret para o webhook global. As próximas entregas já são assinadas com ele.
POST
/
channels
/
whatsapp
/
global-webhook
/
rotate-secret
Rotacionar secret global
curl --request POST \
--url https://cloud.datafyapi.com.br/channels/whatsapp/global-webhook/rotate-secret \
--header 'Authorization: Bearer <token>'const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cloud.datafyapi.com.br/channels/whatsapp/global-webhook/rotate-secret', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://cloud.datafyapi.com.br/channels/whatsapp/global-webhook/rotate-secret"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text){
"webhook_secret": "whsec_xxx"
}{
"statusCode": 401,
"message": "Token de conta ausente ou inválido"
}{
"statusCode": 403,
"message": "Sua assinatura precisa estar ativa para usar a API. Acesse o painel para ativá-la."
}{
"statusCode": 404,
"message": "Nenhum webhook global configurado"
}Resposta
| Campo | Descrição |
|---|---|
webhook_secret | Novo secret usado na assinatura das entregas do webhook global |