curl --request GET \
--url https://api.myidvirtual.com/webhooks/tree \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "<string>"
}
'{
"userId": "user-id-123",
"webhooks": [
{
"id": "webhook-id-1",
"url": "https://servidor.com/webhook",
"events": ["payment.created"]
}
],
"children": []
}
Gerencia a hierarquia de webhooks por usuário
curl --request GET \
--url https://api.myidvirtual.com/webhooks/tree \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "<string>"
}
'{
"userId": "user-id-123",
"webhooks": [
{
"id": "webhook-id-1",
"url": "https://servidor.com/webhook",
"events": ["payment.created"]
}
],
"children": []
}
{
"userId": "user-id-123",
"webhooks": [
{
"id": "webhook-id-1",
"url": "https://servidor.com/webhook",
"events": ["payment.created"]
}
],
"children": []
}
{
"success": true,
"message": "Usuário adicionado à árvore de webhooks"
}
{
"success": true,
"message": "Usuário removido da árvore de webhooks"
}
# Obter árvore
curl --location --request GET 'http://localhost:3333/webhooks/tree' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
# Adicionar à árvore
curl --location --request POST 'http://localhost:3333/webhooks/tree/webhook-id' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...'
# Alterar status
curl --location --request POST 'http://localhost:3333/webhooks/status/webhook-id' \
--header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \
--header 'Content-Type: application/json' \
--data-raw '{"status": "active"}'