Sapo Webhook icon

Sapo Webhook

Quản lý webhook trên Sapo

Overview

This node manages webhooks on the Sapo platform, allowing users to create, retrieve, update, delete, and list webhooks. It is useful for automating integrations where external systems need to be notified about events occurring in Sapo, such as order creation or product updates.

Common scenarios include:

  • Automatically creating a webhook to listen for new orders or customer updates.
  • Retrieving details of a specific webhook by its ID.
  • Updating an existing webhook’s configuration.
  • Deleting a webhook that is no longer needed.
  • Listing multiple webhooks with optional filters and limits.

For example, you might use this node to set up a webhook that triggers when a new order is created, enabling real-time synchronization with your CRM or fulfillment system.

Properties

Name Meaning
Thao Tác (operation) The action to perform: Create, Delete, Get details, List multiple, or Update a webhook.
Webhook ID The unique identifier of the webhook (required for get, update, delete operations).
Trả Về Tất Cả (returnAll) Whether to return all webhook results or limit the number returned (only for listing operation).
Giới Hạn (limit) Maximum number of webhook results to return when not returning all (minimum 1).
Dữ Liệu Webhook (data) JSON object defining webhook details such as topic, address URL, format, fields, and namespaces (for create and update).
Thông Tin Bổ Sung (additionalFields) Additional filtering options for listing webhooks, including:
- Chủ Đề (topic): event type to filter by (e.g., orders/create, products/update).
- Tạo Sau (created_at_min): filter webhooks created after this date/time.
- Tạo Trước (created_at_max): filter webhooks created before this date/time.
- Cập Nhật Sau (updated_at_min): filter webhooks updated after this date/time.
- Cập Nhật Trước (updated_at_max): filter webhooks updated before this date/time.

Output

The node outputs an array with one item containing a json field:

  • For create, get, update operations: The json contains the webhook object returned by the API, including details like webhook ID, topic, address, format, and other metadata.
  • For delete operation: The json contains { success: true } indicating successful deletion.
  • For getMany (list) operation: The json contains an array or paginated list of webhook objects matching the filters and limits specified.

No binary data output is produced by this node.

Dependencies

  • Requires an active connection to the Sapo API via an API key credential configured in n8n.
  • Uses the internal Sapo API base class to interact with webhook endpoints.
  • No additional external dependencies beyond the Sapo API access.

Troubleshooting

  • Common issues:

    • Invalid or missing API credentials will cause authentication errors.
    • Providing an invalid webhook ID for get, update, or delete operations will result in "not found" errors.
    • Exceeding API rate limits may cause request failures.
    • Incorrectly formatted JSON in the webhook data property can cause validation errors.
  • Error messages:

    • Errors from the Sapo API are caught and returned as node errors unless "Continue On Fail" is enabled, in which case they appear in the output as error messages.
    • Typical error message includes the API error message and stack trace for debugging.
  • Resolutions:

    • Verify API credentials and permissions.
    • Double-check webhook IDs and input parameters.
    • Use valid JSON structure for webhook data.
    • Enable "Continue On Fail" to handle errors gracefully during bulk operations.

Links and References

Discussion