Trinks icon

Trinks

Nó N8N para interagir com a API do Trinks

Actions46

Overview

This node integrates with the Trinks API to update the status of a specific appointment ("Agendamento") to "cancelado" (canceled). It is designed to send a PATCH request to the endpoint /v1/agendamentos/{agendamentoId}/status/cancelado, allowing users to mark an appointment as canceled by providing the appointment ID, who canceled it, and the reason for cancellation.

Common scenarios include:

  • Automating appointment cancellations in scheduling workflows.
  • Syncing cancellation status from external systems into Trinks.
  • Managing appointment lifecycle states programmatically.

Practical example:

  • A salon booking system automatically cancels appointments when customers notify via a chatbot, updating the Trinks system accordingly.

Properties

Name Meaning
Agendamento Id The unique numeric identifier of the appointment to be canceled.
Quem Cancelou Numeric identifier representing who performed the cancellation (e.g., user or system ID).
Motivo Textual reason explaining why the appointment was canceled.

Output

The node outputs the JSON response returned by the Trinks API after attempting to cancel the appointment. This typically includes confirmation of the updated status or error details if the operation failed.

No binary data output is produced by this node.

Example output structure (simplified):

{
  "id": 123,
  "status": "cancelado",
  "quemCancelou": 456,
  "motivo": "Cliente não compareceu",
  "updatedAt": "2024-06-01T12:00:00Z"
}

Dependencies

  • Requires an API key credential and an establishment ID configured in n8n credentials to authenticate requests to the Trinks API.
  • The node sends HTTP PATCH requests to https://api.trinks.com.
  • Proper network access to the Trinks API endpoint is necessary.

Troubleshooting

  • Common issues:

    • Invalid or missing API key or establishment ID will cause authentication failures.
    • Providing an invalid or non-existent Agendamento Id will result in errors from the API.
    • Missing required properties (quemCancelou or motivo) may cause the request to fail validation.
  • Error messages:

    • "Operation ... not found": Indicates the selected operation is not recognized; ensure the correct resource and operation are chosen.
    • HTTP 4xx or 5xx errors from the API: Check credentials, input values, and API availability.
  • Resolution tips:

    • Verify all required fields are correctly set.
    • Confirm API credentials are valid and have sufficient permissions.
    • Inspect the API response message for detailed error information.

Links and References

Discussion